everything StoresOreInfo onward

This commit is contained in:
Chris Forbes
2010-01-10 13:28:46 +13:00
parent fee63593d7
commit 040d251350
8 changed files with 34 additions and 29 deletions

View File

@@ -271,7 +271,6 @@
<Compile Include="Traits\TakeCover.cs" />
<Compile Include="Traits\Thief.cs" />
<Compile Include="Traits\TraitsInterfaces.cs" />
<Compile Include="Traits\Tree.cs" />
<Compile Include="Traits\Turreted.cs" />
<Compile Include="Traits\Unit.cs" />
<Compile Include="Traits\WaterPaletteRotation.cs" />

View File

@@ -3,16 +3,17 @@ using System;
using OpenRa.Game.GameRules;
namespace OpenRa.Game.Traits
{
class StoresOreInfo : ITraitInfo
{
public readonly int Pips = 0;
public readonly int Capacity = 0;
public object Create(Actor self) { return new StoresOre(self); }
}
class StoresOre : IPips, IAcceptThief
{
public const int MaxStealAmount = 100; //todo: How is cash stolen determined?
readonly Actor self;
public StoresOre(Actor self)
{
this.self = self;
}
public StoresOre(Actor self) {}
public void OnSteal(Actor self, Actor thief)
{

View File

@@ -4,6 +4,11 @@ using OpenRa.Game.Graphics;
namespace OpenRa.Game.Traits
{
class SubmarineInfo : ITraitInfo
{
public object Create(Actor self) { return new Submarine(self); }
}
class Submarine : IRenderModifier, INotifyAttack, ITick, INotifyDamage
{
[Sync]

View File

@@ -1,6 +1,11 @@

namespace OpenRa.Game.Traits
{
class TakeCoverInfo : ITraitInfo
{
public object Create(Actor self) { return new TakeCover(self); }
}
// infantry prone behavior
class TakeCover : ITick, INotifyDamage, IDamageModifier, ISpeedModifier
{

View File

@@ -3,6 +3,11 @@ using System.Collections.Generic;
using System.Linq;
namespace OpenRa.Game.Traits
{
class ThiefInfo : ITraitInfo
{
public object Create(Actor self) { return new Thief(self); }
}
class Thief : IIssueOrder, IResolveOrder
{
public Thief(Actor self) { }

View File

@@ -1,20 +0,0 @@
using System.Collections.Generic;
using OpenRa.Game.Graphics;
namespace OpenRa.Game.Traits
{
class Tree : IRender
{
Sprite Image;
public Tree(Sprite treeImage)
{
Image = treeImage;
}
public IEnumerable<Renderable> Render(Actor self)
{
yield return new Renderable(Image, Game.CellSize * (float2)self.Location, 0);
}
}
}

View File

@@ -2,6 +2,11 @@
namespace OpenRa.Game.Traits
{
class WaterPaletteRotationInfo : ITraitInfo
{
public object Create(Actor self) { return new WaterPaletteRotation(self); }
}
class WaterPaletteRotation : ITick, IPaletteModifier
{
public WaterPaletteRotation(Actor self) { }

View File

@@ -6,6 +6,11 @@ using OpenRa.Game.Graphics;
namespace OpenRa.Game.Traits
{
class WithShadowInfo : ITraitInfo
{
public object Create(Actor self) { return new WithShadow(self); }
}
class WithShadow : IRenderModifier
{
public WithShadow(Actor self) {}