public override void Step()
        {
            ActionCellEvtArgs args = new ActionCellEvtArgs();

            args.TypeCard = _typeCard;

            CellStepped?.Invoke(this, args);
        }
Esempio n. 2
0
        public void ActionOnCellStepped(object sender, EventArgs evt)
        {
            MonopolyCell      cell   = (MonopolyCell)sender;
            MonopolyPlayer    player = GetPlayerFromCell(cell);
            ActionCellEvtArgs args   = (ActionCellEvtArgs)evt;

            Console.WriteLine(player.Username + " stepped in " + cell.Name);

            // Get action
            IActionCard             card       = GetActionCard(args.TypeCard);
            Action <MonopolyPlayer> cardAction = card.Action;

            // Do action
            cardAction(GetPlayerFromCell((MonopolyCell)sender));
        }