moved traits from engine into mod

This commit is contained in:
Bob
2010-09-20 20:56:11 +12:00
parent 65515d54af
commit aff6889995
15 changed files with 43 additions and 44 deletions

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Graphics
{
readonly World world;
internal readonly TerrainRenderer terrainRenderer;
internal readonly UiOverlay uiOverlay;
public readonly UiOverlay uiOverlay;
internal readonly HardwarePalette palette;
internal WorldRenderer(World world)

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -75,7 +75,6 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Effects\RepairIndicator.cs" />
<Compile Include="GameRules\WeaponInfo.cs" />
<Compile Include="Group.cs" />
<Compile Include="Orders\GenericSelectTarget.cs" />
@@ -135,7 +134,6 @@
<Compile Include="Traits\Activities\RemoveSelf.cs" />
<Compile Include="Traits\Activities\Sell.cs" />
<Compile Include="Orders\IOrderGenerator.cs" />
<Compile Include="Orders\PlaceBuildingOrderGenerator.cs" />
<Compile Include="Player.cs" />
<Compile Include="Graphics\Sheet.cs" />
<Compile Include="PathFinder.cs" />
@@ -158,17 +156,13 @@
<Compile Include="Traits\Buildable.cs" />
<Compile Include="Traits\Building.cs" />
<Compile Include="Traits\World\BuildingInfluence.cs" />
<Compile Include="Traits\Player\PlaceBuilding.cs" />
<Compile Include="Traits\World\PlayerColorPalette.cs" />
<Compile Include="Traits\World\ResourceLayer.cs" />
<Compile Include="Traits\World\ResourceType.cs" />
<Compile Include="Traits\SupportPower.cs" />
<Compile Include="Traits\ProvidesRadar.cs" />
<Compile Include="Traits\Selectable.cs" />
<Compile Include="Traits\Player\ProductionQueue.cs" />
<Compile Include="Traits\Mobile.cs" />
<Compile Include="Traits\Production.cs" />
<Compile Include="Traits\RallyPoint.cs" />
<Compile Include="Traits\Render\RenderSimple.cs" />
<Compile Include="Traits\TraitsInterfaces.cs" />
<Compile Include="Traits\Turreted.cs" />
@@ -215,7 +209,6 @@
<Compile Include="Traits\RevealsShroud.cs" />
<Compile Include="Traits\Targetable.cs" />
<Compile Include="Traits\Health.cs" />
<Compile Include="Traits\RepairableBuilding.cs" />
<Compile Include="Traits\Activities\Drag.cs" />
<Compile Include="Widgets\VqaPlayerWidget.cs" />
<Compile Include="Widgets\Delegates\VideoPlayerDelegate.cs" />
@@ -226,7 +219,6 @@
<Compile Include="Traits\Armor.cs" />
<Compile Include="Graphics\CursorProvider.cs" />
<Compile Include="Traits\Player\TechTree.cs" />
<Compile Include="Traits\Player\ClassicProductionQueue.cs" />
<Compile Include="Traits\Player\PowerManager.cs" />
</ItemGroup>
<ItemGroup>
@@ -242,7 +234,6 @@
<Compile Include="ObjectCreator.cs" />
<Compile Include="Network\SyncReport.cs" />
<Compile Include="TraitDictionary.cs" />
<Compile Include="Traits\PrimaryBuilding.cs" />
<Compile Include="Widgets\Delegates\DeveloperModeDelegate.cs" />
</ItemGroup>
<ItemGroup>

View File

@@ -13,7 +13,7 @@ using System.Linq;
namespace OpenRA.Traits
{
class PlayerResourcesInfo : ITraitInfo
public class PlayerResourcesInfo : ITraitInfo
{
public readonly int InitialCash = 10000;
public readonly int InitialOre = 0;

View File

@@ -18,7 +18,7 @@ using OpenRA.Widgets;
namespace OpenRA
{
class UiOverlay
public class UiOverlay
{
Sprite buildOk, buildBlocked, unitDebug;
@@ -79,7 +79,7 @@ namespace OpenRA
}
}
static class LineBuildUtils
public static class LineBuildUtils
{
public static IEnumerable<int2> GetLineBuildCells(World world, int2 location, string name, BuildingInfo bi)
{

View File

@@ -9,10 +9,11 @@
#endregion
using System.Collections.Generic;
using OpenRA.Effects;
using OpenRA.Graphics;
using OpenRA.Traits;
namespace OpenRA.Effects
namespace OpenRA.Mods.RA.Effects
{
class RepairIndicator : IEffect
{

View File

@@ -87,17 +87,26 @@
<Compile Include="Effects\GravityBomb.cs" />
<Compile Include="Effects\LaserZap.cs" />
<Compile Include="Effects\Missile.cs" />
<Compile Include="Effects\RepairIndicator.cs" />
<Compile Include="Effects\Smoke.cs" />
<Compile Include="Effects\TeslaZap.cs" />
<Compile Include="LimitedAmmo.cs" />
<Compile Include="Orders\PlaceBuildingOrderGenerator.cs" />
<Compile Include="Player\ActorGroupProxy.cs" />
<Compile Include="Aircraft.cs" />
<Compile Include="Player\ClassicProductionQueue.cs" />
<Compile Include="Player\PlaceBuilding.cs" />
<Compile Include="Player\ProductionQueue.cs" />
<Compile Include="PrimaryBuilding.cs" />
<Compile Include="Production.cs" />
<Compile Include="RallyPoint.cs" />
<Compile Include="RenderDetectionCircle.cs" />
<Compile Include="RenderRangeCircle.cs" />
<Compile Include="Render\RenderBuilding.cs" />
<Compile Include="Render\RenderBuildingTurreted.cs" />
<Compile Include="Render\RenderUnit.cs" />
<Compile Include="Render\RenderUnitTurreted.cs" />
<Compile Include="RepairableBuilding.cs" />
<Compile Include="ReservableProduction.cs" />
<Compile Include="SupportPowers\AirstrikePower.cs" />
<Compile Include="AttackFrontal.cs" />

View File

@@ -13,7 +13,7 @@ using System.Linq;
using OpenRA.GameRules;
using OpenRA.Traits;
namespace OpenRA.Orders
namespace OpenRA.Mods.RA.Orders
{
public class PlaceBuildingOrderGenerator : IOrderGenerator
{

View File

@@ -8,12 +8,11 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.FileFormats;
using OpenRA.Traits;
namespace OpenRA.Traits
namespace OpenRA.Mods.RA
{
public class ClassicProductionQueueInfo : ProductionQueueInfo, ITraitPrerequisite<TechTreeInfo>, ITraitPrerequisite<PowerManagerInfo>, ITraitPrerequisite<PlayerResourcesInfo>
{

View File

@@ -10,10 +10,10 @@
using System.Linq;
using OpenRA.Effects;
using OpenRA.GameRules;
using OpenRA.FileFormats;
using OpenRA.Traits;
namespace OpenRA.Traits
namespace OpenRA.Mods.RA
{
class PlaceBuildingInfo : TraitInfo<PlaceBuilding> {}

View File

@@ -11,8 +11,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Traits
namespace OpenRA.Mods.RA
{
public class ProductionQueueInfo : ITraitInfo
{

View File

@@ -10,8 +10,9 @@
using System.Collections.Generic;
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Traits
namespace OpenRA.Mods.RA
{
class PrimaryBuildingInfo : TraitInfo<PrimaryBuilding> { }

View File

@@ -8,11 +8,11 @@
*/
#endregion
using System.Collections.Generic;
using System.Drawing;
using OpenRA.FileFormats;
using OpenRA.Traits;
namespace OpenRA.Traits
namespace OpenRA.Mods.RA
{
public class ProductionInfo : ITraitInfo
{
@@ -61,7 +61,7 @@ namespace OpenRA.Traits
// Animate the spawn -> exit transition
var speed = move.MovementSpeedForCell(self, exit);
var length = speed > 0 ? (int)( ( to - spawn ).Length*3 / speed ) : 0;
newUnit.QueueActivity(new Activities.Drag(spawn, to, length));
newUnit.QueueActivity(new Traits.Activities.Drag(spawn, to, length));
// Log.Write("debug", "length={0} facing={1} exit={2} spawn={3}", length, facing.Facing, exit, spawn);
@@ -72,7 +72,7 @@ namespace OpenRA.Traits
{
target = rp.rallyPoint;
// Todo: Move implies unit has Mobile
newUnit.QueueActivity(new Activities.Move(target, 1));
newUnit.QueueActivity(new Traits.Activities.Move(target, 1));
}
if (newUnit.Owner == self.World.LocalPlayer)

View File

@@ -11,8 +11,9 @@
using System.Collections.Generic;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Traits;
namespace OpenRA.Traits
namespace OpenRA.Mods.RA
{
class RallyPointInfo : ITraitInfo, ITraitPrerequisite<RenderSimpleInfo>
{
@@ -38,8 +39,8 @@ namespace OpenRA.Traits
public IEnumerable<Renderable> Render(Actor self)
{
if (self.Owner == self.World.LocalPlayer && self.World.Selection.Actors.Contains(self))
yield return Util.Centered(self,
anim.Image, Util.CenterOfCell(rallyPoint));
yield return Traits.Util.Centered(self,
anim.Image, Traits.Util.CenterOfCell(rallyPoint));
}
public int OrderPriority(Actor self, int2 xy, MouseInput mi, Actor underCursor)

View File

@@ -9,14 +9,10 @@
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Effects;
using OpenRA.GameRules;
using OpenRA.Traits.Activities;
using OpenRA.Mods.RA.Effects;
using OpenRA.Traits;
namespace OpenRA.Traits
namespace OpenRA.Mods.RA
{
public class RepairableBuildingInfo : ITraitInfo, ITraitPrerequisite<HealthInfo>
{

View File

@@ -14,7 +14,7 @@ using System.Drawing;
using System.Linq;
using OpenRA.FileFormats;
using OpenRA.Graphics;
using OpenRA.Orders;
using OpenRA.Mods.RA.Orders;
using OpenRA.Traits;
using OpenRA.Widgets;