public Player(string name, PlayerType type, TicTacToeMark mark) { this.Id = Guid.NewGuid(); Name = name; Type = type; Mark = mark; }
public void Set(TicTacToeMark mark) { Mark = mark; Emote = mark switch { TicTacToeMark.X => XEmote, TicTacToeMark.O => OEmote, _ => BlankEmote }; } }
public void Set(TicTacToeBoardPosition position, TicTacToeMark mark) { if (position == TicTacToeBoardPosition.TopLeft) { Board[0, 0].Set(mark); } else if (position == TicTacToeBoardPosition.Top) { Board[1, 0].Set(mark); } else if (position == TicTacToeBoardPosition.TopRight) { Board[2, 0].Set(mark); } else if (position == TicTacToeBoardPosition.Left) { Board[1, 0].Set(mark); } else if (position == TicTacToeBoardPosition.Middle) { Board[1, 1].Set(mark); } else if (position == TicTacToeBoardPosition.Right) { Board[1, 2].Set(mark); } else if (position == TicTacToeBoardPosition.BottomLeft) { Board[2, 0].Set(mark); } else if (position == TicTacToeBoardPosition.Bottom) { Board[2, 1].Set(mark); } else { Board[2, 2].Set(mark); } }