public void PlaceUnit(MapUnit unit, MapCell cell) { if (cell.unitPresent != null) { throw new ArgumentException("Cell not empty!"); } cell.unitPresent = unit; unit.transform.parent = cell.transform; unit.transform.position = cell.transform.position; unitIndex[unit] = cell.loc; cell.fog = CellFogOfWar.clear; }
public HexCoords WhereIs(MapUnit unit) { return(unitIndex[unit]); }
public bool HasUnit(MapUnit unit) { return(unitIndex.ContainsKey(unit)); }
public void UnplaceUnit(MapUnit unit) { CellAt(WhereIs(unit)).unitPresent = null; unit.transform.parent = transform; unitIndex.Remove(unit); }
public void PlaceUnit(MapUnit unit, HexCoords loc) { PlaceUnit(unit, CellAt(loc)); }
public MapCell UnitCell(MapUnit unit) { return(CellAt(WhereIs(unit))); }