cache => controlGroups; not sure what i was smoking then. also more sane exceptions in Actor.ctor

This commit is contained in:
Chris Forbes
2009-12-17 10:17:51 +13:00
parent f729c130c7
commit 942cb08f51
3 changed files with 58 additions and 30 deletions

View File

@@ -149,7 +149,7 @@ namespace OpenRa.Game
}
}
Cache<int, List<Actor>> cache = new Cache<int, List<Actor>>(_ => new List<Actor>());
Cache<int, List<Actor>> controlGroups = new Cache<int, List<Actor>>(_ => new List<Actor>());
public void DoControlGroup(int group, Modifiers mods)
{
@@ -159,19 +159,19 @@ namespace OpenRa.Game
if (uog == null || !uog.selection.Any())
return;
cache[group].Clear();
cache[group].AddRange(uog.selection);
controlGroups[group].Clear();
controlGroups[group].AddRange(uog.selection);
return;
}
if (mods.HasModifier(Modifiers.Alt))
{
Game.viewport.Center(cache[group]);
Game.viewport.Center(controlGroups[group]);
return;
}
if (uog == null) return;
CombineSelection(cache[group], mods.HasModifier(Modifiers.Shift), false);
CombineSelection(controlGroups[group], mods.HasModifier(Modifiers.Shift), false);
}
}
}