private void HandleNewTileInspection(Tile tile, Input.InteractionType type) { if (!(type == Input.InteractionType.Select || type == Input.InteractionType.Inspect)) { return; } int actives = 0; int busies = 0; int building = 0; var units = Military.AllUnits(tile, Game.activeUserID, unitType); Debug.Log(string.Format("Summing up units of type {0} for player {1} ({2})", unitType, Game.activeUserID, units.Count)); while (units.Count > 0) { var unit = units.Dequeue(); if (unit.underConstruction) { building += unit.count; } else if (unit.available) { actives += unit.count; } else { busies += unit.count; } } UpdateText(actives, busies, building); }
public void Show() { totalCountAvailable = deploymentOrder.GetCount(type);; var units = Military.AllUnits(type); while (units.Count > 0) { var unit = units.Dequeue(); totalCountAvailable += unit.available ? unit.count : 0; } if (totalCountAvailable > 0) { //UpdateCount(totalCountAvailable); Debug.Log("Can allocate " + totalCountAvailable); } else { Hide(); } }