undo problematic caching

This commit is contained in:
Chris Forbes
2010-03-18 13:33:43 +13:00
parent 8a05af72b3
commit 07b0c77db4
4 changed files with 18 additions and 21 deletions

View File

@@ -49,22 +49,20 @@ namespace OpenRA
public int PowerProvided = 0;
public int PowerDrained = 0;
public Shroud Shroud;
public World World { get { return PlayerActor.World; } }
public static List<Tuple<string, string, Color>> PlayerColors = new List<Tuple<string, string, Color>>();
public static void ResetPlayerColorList()
public static List<Tuple<string, string, Color>> PlayerColors
{
// This is unsafe if the mapchange introduces/removes mods that defines new colors
// TODO: ensure that each player's palette index is reassigned appropriately
PlayerColors = new List<Tuple<string, string, Color>>();
get
{
return Game.world.WorldActor.Info.Traits.WithInterface<PlayerColorPaletteInfo>()
.Where(p => p.Playable)
.Select(p => Tuple.New(p.Name, p.DisplayName, p.Color))
.ToList();
}
}
public static void RegisterPlayerColor(string palette, string name, Color c)
{
PlayerColors.Add(new Tuple<string, string, Color>(palette, name, c));
}
public Shroud Shroud;
public Player( World world, Session.Client client )
{