Fix StyleCop issues in TechTree.

This commit is contained in:
Paul Chote
2013-12-08 21:40:59 +13:00
parent e76dbcd4bf
commit bbc19df512

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
@@ -53,7 +53,7 @@ namespace OpenRA.Mods.RA
public void Remove(string key)
{
watchers.RemoveAll(x => x.key == key);
watchers.RemoveAll(x => x.Key == key);
}
static Cache<string, List<Actor>> GatherBuildables(Player player)
@@ -89,16 +89,17 @@ namespace OpenRA.Mods.RA
class Watcher
{
public readonly string key;
public readonly string Key;
// strings may be either actor type, or "alternate name" key
public readonly string[] prerequisites;
public readonly ITechTreeElement watcher;
readonly string[] prerequisites;
readonly ITechTreeElement watcher;
bool hasPrerequisites;
int buildLimit;
public Watcher(string key, BuildableInfo info, ITechTreeElement watcher)
{
this.key = key;
this.Key = key;
this.prerequisites = info.Prerequisites;
this.watcher = watcher;
this.hasPrerequisites = false;
@@ -112,15 +113,14 @@ namespace OpenRA.Mods.RA
public void Update(Cache<string, List<Actor>> buildables)
{
var hasReachedBuildLimit = buildLimit > 0 && buildables[key].Count >= buildLimit;
var hasReachedBuildLimit = buildLimit > 0 && buildables[Key].Count >= buildLimit;
var nowHasPrerequisites = HasPrerequisites(buildables) && !hasReachedBuildLimit;
if (nowHasPrerequisites && !hasPrerequisites)
watcher.PrerequisitesAvailable(key);
watcher.PrerequisitesAvailable(Key);
if (!nowHasPrerequisites && hasPrerequisites)
watcher.PrerequisitesUnavailable(key);
watcher.PrerequisitesUnavailable(Key);
hasPrerequisites = nowHasPrerequisites;
}
@@ -136,13 +136,13 @@ namespace OpenRA.Mods.RA
public class ProvidesCustomPrerequisite : ITechTreePrerequisite
{
ProvidesCustomPrerequisiteInfo Info;
ProvidesCustomPrerequisiteInfo info;
public IEnumerable<string> ProvidesPrerequisites { get { yield return Info.Prerequisite; } }
public IEnumerable<string> ProvidesPrerequisites { get { yield return info.Prerequisite; } }
public ProvidesCustomPrerequisite(ProvidesCustomPrerequisiteInfo info)
{
Info = info;
this.info = info;
}
}
}