private void PortalQuery(Unity.Entities.Entity entity, ref StrategyHexAccessPortal.Component portal) { if (isUpdated) { return; } var indexes = portal.HexIndexes; var hexes = portal.FrontHexes; if (indexes.Count == 0 && hexes.Count == 0) { return; } this.hexIndexes.Clear(); foreach (var i in indexes) { HexLocalInfo local = null; this.HexDic?.TryGetValue(i.Key, out local); this.hexIndexes.Add(i.Key, new HexIndexPower(i.Value, local)); } this.frontHexes.Clear(); foreach (var h in hexes) { this.frontHexes.Add(h.Key, h.Value); } isUpdated = true; }
public HexIndexPower(HexIndex index, HexLocalInfo local) { this.hexIndex = index; SidePowers = local == null ? new Dictionary <UnitSide, float>(): local.Powers; }