checkpoint
This commit is contained in:
@@ -8,11 +8,11 @@ namespace Gameboard.ShogiUI.Sockets.Models
|
||||
public class Piece : IPlanarElement
|
||||
{
|
||||
public WhichPiece WhichPiece { get; }
|
||||
public WhichPlayer Owner { get; private set; }
|
||||
public WhichPerspective Owner { get; private set; }
|
||||
public bool IsPromoted { get; private set; }
|
||||
public bool IsUpsideDown => Owner == WhichPlayer.Player2;
|
||||
public bool IsUpsideDown => Owner == WhichPerspective.Player2;
|
||||
|
||||
public Piece(WhichPiece piece, WhichPlayer owner, bool isPromoted = false)
|
||||
public Piece(WhichPiece piece, WhichPerspective owner, bool isPromoted = false)
|
||||
{
|
||||
WhichPiece = piece;
|
||||
Owner = owner;
|
||||
@@ -28,9 +28,9 @@ namespace Gameboard.ShogiUI.Sockets.Models
|
||||
|
||||
public void ToggleOwnership()
|
||||
{
|
||||
Owner = Owner == WhichPlayer.Player1
|
||||
? WhichPlayer.Player2
|
||||
: WhichPlayer.Player1;
|
||||
Owner = Owner == WhichPerspective.Player1
|
||||
? WhichPerspective.Player2
|
||||
: WhichPerspective.Player1;
|
||||
}
|
||||
|
||||
public void Promote() => IsPromoted = CanPromote;
|
||||
|
||||
Reference in New Issue
Block a user