예제 #1
0
    private Unit GetNewUnit(int unitId, InitialUnitConfig initialUnitConfig, IGrid grid)
    {
        var spawnCell = GetSpawnCell(grid, initialUnitConfig);
        var unit      = _unitFactory.GetUnit(unitId, initialUnitConfig.UnitConfig);

        unit.CurrentCell = spawnCell;
        return(unit);
    }
예제 #2
0
        public Unit GetUnit(UnitType type)
        {
            switch (type)
            {
            case UnitType.Mag:
                return(_magFactory.GetUnit(type));

            case UnitType.Infantry:
                return(_infantryFactory.GetUnit(type));

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }
        }