Rename RenderBuildingOre -> RenderBuildingSilo

This commit is contained in:
Paul Chote
2011-07-24 17:59:50 +12:00
parent 2231940056
commit eadf6fe6cf
4 changed files with 7 additions and 7 deletions

View File

@@ -0,0 +1,43 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 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,
* see COPYING.
*/
#endregion
using OpenRA.Traits;
namespace OpenRA.Mods.RA.Render
{
class RenderBuildingSiloInfo : RenderBuildingInfo
{
public override object Create(ActorInitializer init) { return new RenderBuildingSilo(init, this); }
}
class RenderBuildingSilo : RenderBuilding, INotifyBuildComplete, INotifyCapture
{
PlayerResources playerResources;
public RenderBuildingSilo( ActorInitializer init, RenderBuildingInfo info )
: base(init, info)
{
playerResources = init.self.Owner.PlayerActor.Trait<PlayerResources>();
}
public void BuildingComplete( Actor self )
{
anim.PlayFetchIndex("idle",
() => playerResources.OreCapacity != 0
? (49 * playerResources.Ore) / (10 * playerResources.OreCapacity)
: 0);
}
public void OnCapture (Actor self, Actor captor, Player oldOwner, Player newOwner)
{
playerResources = newOwner.PlayerActor.Trait<PlayerResources>();
}
}
}