Skip to content

Commit

Permalink
Merge pull request #6 from TheNegumProject/net7
Browse files Browse the repository at this point in the history
NET 7 + TreatWarningAsErrors
  • Loading branch information
Sejoslaw authored Dec 16, 2022
2 parents 717b02d + 5bd89bf commit cde8ba0
Show file tree
Hide file tree
Showing 181 changed files with 8,990 additions and 9,037 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
dotnet-version: 7.0.x

- name: Restore dependencies
run: dotnet restore
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,6 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/

# Rider
.idea
143 changes: 71 additions & 72 deletions Negum.Core/Configurations/Animations/IAnimationElement.cs
Original file line number Diff line number Diff line change
@@ -1,84 +1,83 @@
namespace Negum.Core.Configurations.Animations
namespace Negum.Core.Configurations.Animations;

/// <summary>
/// Represents a single animation frame defined in an AIR file.
/// </summary>
///
/// <author>
/// https://github.com/TheNegumProject/Negum.Core
/// </author>
public interface IAnimationElement
{
/// <summary>
/// Represents a single animation frame defined in an AIR file.
/// 1st number is the sprite's group number.
/// </summary>
///
/// <author>
/// https://github.com/TheNegumProject/Negum.Core
/// </author>
public interface IAnimationElement
{
/// <summary>
/// 1st number is the sprite's group number.
/// </summary>
int SpriteGroup { get; }
int SpriteGroup { get; }

/// <summary>
/// 2nd number is the sprite's image number.
/// </summary>
int SpriteImage { get; }
/// <summary>
/// 2nd number is the sprite's image number.
/// </summary>
int SpriteImage { get; }

/// <summary>
/// The 3rd and 4th numbers of the element are the X and Y offsets from this sprite's axis.
/// If you want the sprite to appear 5 pixels forwards, put "5" for the 3rd number.
/// </summary>
int OffsetX { get; }
/// <summary>
/// The 3rd and 4th numbers of the element are the X and Y offsets from this sprite's axis.
/// If you want the sprite to appear 5 pixels forwards, put "5" for the 3rd number.
/// </summary>
int OffsetX { get; }

/// <summary>
/// The 3rd and 4th numbers of the element are the X and Y offsets from this sprite's axis.
/// To make the sprite 15 pixels up, put "-15" for the 4th number, and so on.
/// </summary>
int OffsetY { get; }
/// <summary>
/// The 3rd and 4th numbers of the element are the X and Y offsets from this sprite's axis.
/// To make the sprite 15 pixels up, put "-15" for the 4th number, and so on.
/// </summary>
int OffsetY { get; }

/// <summary>
/// 5th number is the length of time to display the element before moving onto the next, measured in game-ticks.
/// There are 60 game-ticks in one second at normal game speed.
/// For the 5th number, you can specify "-1" if you want that element to be displayed indefinitely (or until you switch to a different action).
/// If you choose to do this, do it only on the last element of the action.
/// </summary>
int DisplayTime { get; }
/// <summary>
/// 5th number is the length of time to display the element before moving onto the next, measured in game-ticks.
/// There are 60 game-ticks in one second at normal game speed.
/// For the 5th number, you can specify "-1" if you want that element to be displayed indefinitely (or until you switch to a different action).
/// If you choose to do this, do it only on the last element of the action.
/// </summary>
int DisplayTime { get; }

/// <summary>
/// If you want to flip the sprite horizontally and/or vertically, you will need to use the "flip" parameters:
/// V - for vertical flip,
/// H - for horizontal flip.
/// These parameters will be 6th on the line.
///
/// Flipping the sprite around is especially useful for making throws.
/// The opponent who is being thrown will temporarily get the player's animation data, and enter the "being thrown" animation action.
/// You'll might have to flip the sprites around to make the "thrown" action look correct.
/// </summary>
string Flip { get; }
/// <summary>
/// If you want to flip the sprite horizontally and/or vertically, you will need to use the "flip" parameters:
/// V - for vertical flip,
/// H - for horizontal flip.
/// These parameters will be 6th on the line.
///
/// Flipping the sprite around is especially useful for making throws.
/// The opponent who is being thrown will temporarily get the player's animation data, and enter the "being thrown" animation action.
/// You'll might have to flip the sprites around to make the "thrown" action look correct.
/// </summary>
string? Flip { get; }

/// <summary>
/// For certain things such as hit sparks, you might like to use color addition to draw the sprite, making it look "transparent".
/// You won't need to use this to make a character, so you don't have to worry about this if you choose not to.
/// The parameters for color addition and subtraction are "A" and "S" respectively, and should go as the 7th on the line.
///
/// If you wish to specify alpha values for color addition, use the parameter format "AS???D???",
/// where ??? represents the values of the source and destination alpha respectively.
/// Values range from 0 (low) to 256 (high).
/// For example, "AS64D192" stands for "Add Source_64 to Dest_192".
/// Also, "AS256D256" is equivalent to just "A". A shorthand for "AS256D128" is "A1".
/// </summary>
string Color { get; }
}

/// <summary>
/// For certain things such as hit sparks, you might like to use color addition to draw the sprite, making it look "transparent".
/// You won't need to use this to make a character, so you don't have to worry about this if you choose not to.
/// The parameters for color addition and subtraction are "A" and "S" respectively, and should go as the 7th on the line.
///
/// If you wish to specify alpha values for color addition, use the parameter format "AS???D???",
/// where ??? represents the values of the source and destination alpha respectively.
/// Values range from 0 (low) to 256 (high).
/// For example, "AS64D192" stands for "Add Source_64 to Dest_192".
/// Also, "AS256D256" is equivalent to just "A". A shorthand for "AS256D128" is "A1".
/// </summary>
///
/// <author>
/// https://github.com/TheNegumProject/Negum.Core
/// </author>
public class AnimationElement : IAnimationElement
{
public int SpriteGroup { get; internal set; }
public int SpriteImage { get; internal set; }
public int OffsetX { get; internal set; }
public int OffsetY { get; internal set; }
public int DisplayTime { get; internal set; }
public string Flip { get; internal set; }
public string Color { get; internal set; }
}
string? Color { get; }
}

/// <summary>
/// </summary>
///
/// <author>
/// https://github.com/TheNegumProject/Negum.Core
/// </author>
public class AnimationElement : IAnimationElement
{
public int SpriteGroup { get; internal init; }
public int SpriteImage { get; internal init; }
public int OffsetX { get; internal init; }
public int OffsetY { get; internal init; }
public int DisplayTime { get; internal init; }
public string? Flip { get; internal set; }
public string? Color { get; internal set; }
}
49 changes: 24 additions & 25 deletions Negum.Core/Configurations/Animations/IAnimationSection.cs
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
namespace Negum.Core.Configurations.Animations
namespace Negum.Core.Configurations.Animations;

/// <summary>
/// Represents a definition of a section in configuration which describe AIR aka Animation file.
/// </summary>
///
/// <author>
/// https://github.com/TheNegumProject/Negum.Core
/// </author>
public interface IAnimationSection : IConfigurationSection
{
/// <summary>
/// Represents a definition of a section in configuration which describe AIR aka Animation file.
/// Number of the current action.
/// Action Number are generally next to the Section Name.
/// i.e. [Begin Action 810] where 810 is an Action Number.
/// </summary>
///
/// <author>
/// https://github.com/TheNegumProject/Negum.Core
/// </author>
public interface IAnimationSection : IConfigurationSection
{
/// <summary>
/// Number of the current action.
/// Action Number are generally next to the Section Name.
/// i.e. [Begin Action 810] where 810 is an Action Number.
/// </summary>
int ActionNumber { get; }
}
int ActionNumber { get; }
}

/// <summary>
/// </summary>
///
/// <author>
/// https://github.com/TheNegumProject/Negum.Core
/// </author>
public class AnimationSection : ConfigurationSection, IAnimationSection
{
public int ActionNumber { get; internal set; }
}
/// <summary>
/// </summary>
///
/// <author>
/// https://github.com/TheNegumProject/Negum.Core
/// </author>
public class AnimationSection : ConfigurationSection, IAnimationSection
{
public int ActionNumber { get; internal set; }
}
99 changes: 49 additions & 50 deletions Negum.Core/Configurations/Animations/IAnimationSectionEntry.cs
Original file line number Diff line number Diff line change
@@ -1,60 +1,59 @@
using System.Collections.Generic;

namespace Negum.Core.Configurations.Animations
namespace Negum.Core.Configurations.Animations;

/// <summary>
/// Represents a definition of an entry in a section in configuration which describe AIR aka Animation file.
/// </summary>
///
/// <author>
/// https://github.com/TheNegumProject/Negum.Core
/// </author>
public interface IAnimationSectionEntry : IConfigurationSectionEntry
{
/// <summary>
/// Represents a definition of an entry in a section in configuration which describe AIR aka Animation file.
/// Indicates if this collision box can be described as default.
/// </summary>
bool IsDefault { get; }

/// <summary>
/// Each sprite entry can have its own collision boxes.
/// Clsn2 refers to a plain collision box and Clsn1 refers to an "attacking" box.
/// You use attacking boxes when making attacking actions such as punching and kicking or special moves.
///
/// <author>
/// https://github.com/TheNegumProject/Negum.Core
/// </author>
public interface IAnimationSectionEntry : IConfigurationSectionEntry
{
/// <summary>
/// Indicates if this collision box can be described as default.
/// </summary>
bool IsDefault { get; }

/// <summary>
/// Each sprite entry can have its own collision boxes.
/// Clsn2 refers to a plain collision box and Clsn1 refers to an "attacking" box.
/// You use attacking boxes when making attacking actions such as punching and kicking or special moves.
///
/// 1 - Attacking Box
/// 2 - Plain Box
/// </summary>
int TypeId { get; }

/// <summary>
/// Collection of boxes describing current animations.
/// Each box is build out of 4 values which describe x1, y1, x2, y2 values.
/// </summary>
IEnumerable<string> Boxes { get; }

/// <summary>
/// Animation elements connected with the current entry.
/// </summary>
IEnumerable<IAnimationElement> AnimationElements { get; }
}
/// 1 - Attacking Box
/// 2 - Plain Box
/// </summary>
int TypeId { get; }

/// <summary>
/// Collection of boxes describing current animations.
/// Each box is build out of 4 values which describe x1, y1, x2, y2 values.
/// </summary>
///
/// <author>
/// https://github.com/TheNegumProject/Negum.Core
/// </author>
public class AnimationSectionEntry : ConfigurationSectionEntry, IAnimationSectionEntry
{
public bool IsDefault { get; internal set; }
public int TypeId { get; internal set; }
public IEnumerable<string> Boxes { get; } = new List<string>();
public IEnumerable<IAnimationElement> AnimationElements { get; } = new List<IAnimationElement>();

public void AddBox(string box) =>
((List<string>) this.Boxes).Add(box);

public void AddAnimationElement(IAnimationElement element) =>
((List<IAnimationElement>) this.AnimationElements).Add(element);
}
IEnumerable<string> Boxes { get; }

/// <summary>
/// Animation elements connected with the current entry.
/// </summary>
IEnumerable<IAnimationElement> AnimationElements { get; }
}

/// <summary>
/// </summary>
///
/// <author>
/// https://github.com/TheNegumProject/Negum.Core
/// </author>
public class AnimationSectionEntry : ConfigurationSectionEntry, IAnimationSectionEntry
{
public bool IsDefault { get; internal set; }
public int TypeId { get; internal set; }
public IEnumerable<string> Boxes { get; } = new List<string>();
public IEnumerable<IAnimationElement> AnimationElements { get; } = new List<IAnimationElement>();

public void AddBox(string box) =>
((List<string>) Boxes).Add(box);

public void AddAnimationElement(IAnimationElement element) =>
((List<IAnimationElement>) AnimationElements).Add(element);
}
Loading

0 comments on commit cde8ba0

Please sign in to comment.