Exemple #1
0
        public bool TryExecuteMove(UnitBase executingUnit, IUnitMove moveToExecute)
        {
            // Invoke move implementation based on dynamic polymorphism:
            bool status = ExecuteMoveInternal(executingUnit, (dynamic)moveToExecute);

            // Update visible positions after move
            if (status)
            {
                _gameInstanceService.UpdateVisiblePositionsForTeam(executingUnit.Player.Team);
            }

            return(status);
        }
Exemple #2
0
        // Implementations of the different moves in partial classes

        // Acts as a catch-all for dynamic polymorphism:
        private bool ExecuteMoveInternal(UnitBase unit, IUnitMove move) => false;