public void ClickUnit(MBUnit unit) { MapCoordinate pos = units.Get(unit); switch (State) { case ControlState.DESELECTED: case ControlState.UNIT_MENU: MoveCursorTo(pos); OpenUnitMenu(); break; case ControlState.UNIT_ATTACK: MoveCursorTo(pos); GetSelected().Attack(unit.Unit); CloseRangeSelection(); CloseUnitMenu(); break; default: break; } }
public void RegisterUnit(MBUnit unit) { Units[unit.Unit.Faction].Add(unit); }
public bool IsSelected(MBUnit unit) { return(selected != null && units.Get(selected) == unit); }
private void MoveUnit(MBUnit unit, List <MapCoordinate> path) { units.Remove(unit); units.Add(unit, path[path.Count - 1]); unit.Move(path); }