Rename TechTreeCache -> TechTree
This commit is contained in:
@@ -83,7 +83,6 @@
|
||||
<Compile Include="Traits\BaseBuilding.cs" />
|
||||
<Compile Include="Traits\LintAttributes.cs" />
|
||||
<Compile Include="Traits\Player\PlayerResources.cs" />
|
||||
<Compile Include="Traits\Player\TechTreeCache.cs" />
|
||||
<Compile Include="Traits\World\Shroud.cs" />
|
||||
<Compile Include="Widgets\ChatEntryWidget.cs" />
|
||||
<Compile Include="Widgets\Delegates\ConnectionDialogsDelegate.cs" />
|
||||
@@ -228,6 +227,7 @@
|
||||
<Compile Include="Traits\Armor.cs" />
|
||||
<Compile Include="Graphics\CursorProvider.cs" />
|
||||
<Compile Include="Traits\Player\PlayerProductionQueue.cs" />
|
||||
<Compile Include="Traits\Player\TechTree.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
|
||||
|
||||
@@ -15,7 +15,7 @@ using OpenRA.FileFormats;
|
||||
|
||||
namespace OpenRA.Traits
|
||||
{
|
||||
public class PlayerProductionQueueInfo : ProductionQueueInfo, ITraitPrerequisite<TechTreeCacheInfo>
|
||||
public class PlayerProductionQueueInfo : ProductionQueueInfo, ITraitPrerequisite<TechTreeInfo>
|
||||
{
|
||||
public override object Create(ActorInitializer init) { return new PlayerProductionQueue(init.self, this); }
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenRA.Traits
|
||||
this.self = self;
|
||||
this.Info = info;
|
||||
|
||||
var ttc = playerActor.Trait<TechTreeCache>();
|
||||
var ttc = playerActor.Trait<TechTree>();
|
||||
|
||||
foreach (var a in AllBuildables(Info.Type))
|
||||
{
|
||||
|
||||
@@ -15,16 +15,16 @@ using OpenRA.GameRules;
|
||||
|
||||
namespace OpenRA.Traits
|
||||
{
|
||||
class TechTreeCacheInfo : ITraitInfo
|
||||
class TechTreeInfo : ITraitInfo
|
||||
{
|
||||
public object Create(ActorInitializer init) { return new TechTreeCache(init);}
|
||||
public object Create(ActorInitializer init) { return new TechTree(init);}
|
||||
}
|
||||
|
||||
class TechTreeCache
|
||||
class TechTree
|
||||
{
|
||||
readonly List<Watcher> watchers = new List<Watcher>();
|
||||
readonly Player player;
|
||||
public TechTreeCache(ActorInitializer init)
|
||||
public TechTree(ActorInitializer init)
|
||||
{
|
||||
player = init.self.Owner;
|
||||
init.world.ActorAdded += ActorChanged;
|
||||
@@ -12,7 +12,7 @@ using System.Linq;
|
||||
|
||||
namespace OpenRA.Traits
|
||||
{
|
||||
public abstract class SupportPowerInfo : ITraitInfo, ITraitPrerequisite<TechTreeCacheInfo>
|
||||
public abstract class SupportPowerInfo : ITraitInfo, ITraitPrerequisite<TechTreeInfo>
|
||||
{
|
||||
public readonly bool RequiresPower = true;
|
||||
public readonly bool OneShot = false;
|
||||
@@ -62,7 +62,7 @@ namespace OpenRA.Traits
|
||||
effectivePrereq = Info.Prerequisites
|
||||
.Select(a => a.ToLowerInvariant()).ToArray();
|
||||
|
||||
self.Trait<TechTreeCache>().Add( Info.OrderName, Info.Prerequisites.Select( a => a.ToLowerInvariant() ).ToList(), this );
|
||||
self.Trait<TechTree>().Add( Info.OrderName, Info.Prerequisites.Select( a => a.ToLowerInvariant() ).ToList(), this );
|
||||
}
|
||||
|
||||
public void Tick(Actor self)
|
||||
@@ -101,7 +101,7 @@ namespace OpenRA.Traits
|
||||
return Owner.PlayerActor.Trait<PlayerResources>().GetPowerState() == PowerState.Normal;
|
||||
|
||||
// Takes 0.3ms on pchote's machine -- calling it every tick for every active special power is retarded
|
||||
var buildings = TechTreeCache.GatherBuildings(Owner);
|
||||
var buildings = TechTree.GatherBuildings(Owner);
|
||||
|
||||
return effectivePrereq.All(a => buildings[a].Any(b => !b.Trait<Building>().Disabled));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Player:
|
||||
PlaceBuilding:
|
||||
TechTreeCache:
|
||||
TechTree:
|
||||
NukePower:
|
||||
Image: atomicnh
|
||||
ChargeTime: 5
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Player:
|
||||
TechTreeCache:
|
||||
TechTree:
|
||||
PlayerResources:
|
||||
InitialCash: 5000
|
||||
ActorGroupProxy:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Player:
|
||||
TechTreeCache:
|
||||
TechTree:
|
||||
PlayerProductionQueue@Building:
|
||||
Type: Building
|
||||
BuildSpeed: .4
|
||||
|
||||
Reference in New Issue
Block a user