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); }
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); } }