public Player(Board b, bool w, EntityType ptype, ref AbstractGame.StepHandler onStep) { type = ptype; white = w; board = b; callback = onStep; }
// Defines am i a player one or player two // pt:PlayerType -II- public void AddToGame(Chess game, PlayerType pt) { iam = pt; // Sets the chess object chess = game; // Sets a callback for every step happened AbstractGame.StepHandler ost = new AbstractGame.StepHandler(OnStep); chess.RegisterAsPlayer(ref ost, iam); }
private void Register() { AbstractGame.StepHandler ost = new AbstractGame.StepHandler(onStep); StartGame(); RegisterAsPlayer(ref ost, PlayerType.PlayerOne); RegisterAsPlayer(ref ost, PlayerType.PlayerTwo); }
// Defines am i a player one or player two // pt:PlayerType -II- public void AddToGame(Quarto game, PlayerType pt) { iam = pt; // Sets the quatro object quatro = game; // Sets a callback for every step happened AbstractGame.StepHandler ost = new AbstractGame.StepHandler(OnStep); quatro.RegisterAsPlayer(ref ost, iam); }