Initial commit

This commit is contained in:
Andrio Celos
2022-10-01 16:00:50 +10:00
commit 1f44ab6d56
45 changed files with 5268 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
using System.ComponentModel;
using Newtonsoft.Json;
namespace TableturfBattleServer;
public class Move {
[JsonProperty("card")]
public Card Card { get; }
[JsonProperty("isPass")]
public bool IsPass { get; }
[JsonProperty("x")]
public int X { get; }
[JsonProperty("y")]
public int Y { get; }
[JsonProperty("rotation")]
public int Rotation { get; }
[JsonProperty("isSpecialAttack")]
public bool IsSpecialAttack { get; }
public Move(Card card, bool isPass, int x, int y, int rotation, bool isSpecialAttack) {
this.Card = card ?? throw new ArgumentNullException(nameof(card));
this.IsPass = isPass;
this.X = x;
this.Y = y;
this.Rotation = rotation;
this.IsSpecialAttack = isSpecialAttack;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public bool ShouldSerializeX() => !this.IsPass;
[EditorBrowsable(EditorBrowsableState.Never)]
public bool ShouldSerializeY() => !this.IsPass;
[EditorBrowsable(EditorBrowsableState.Never)]
public bool ShouldSerializeRotation() => !this.IsPass;
[EditorBrowsable(EditorBrowsableState.Never)]
public bool ShouldSerializeIsSpecialAttack() => !this.IsPass;
}