moved CallFunc, Wait activities to ra

This commit is contained in:
Chris Forbes
2010-05-20 19:14:16 +12:00
parent 43eb4b03ea
commit 9215fa4d28
6 changed files with 44 additions and 40 deletions

View File

@@ -145,7 +145,6 @@
<Compile Include="Traits\World\ChoosePaletteOnSelect.cs" />
<Compile Include="Traits\World\Country.cs" />
<Compile Include="Traits\Activities\Attack.cs" />
<Compile Include="Traits\Activities\CallFunc.cs" />
<Compile Include="Traits\Activities\TransformIntoActor.cs" />
<Compile Include="Actor.cs" />
<Compile Include="Effects\Bullet.cs" />
@@ -239,7 +238,6 @@
<Compile Include="Widgets\BackgroundWidget.cs" />
<Compile Include="Widgets\LabelWidget.cs" />
<Compile Include="Widgets\CheckboxWidget.cs" />
<Compile Include="Traits\Activities\Wait.cs" />
<Compile Include="Traits\World\GlobalDefaults.cs" />
<Compile Include="Traits\World\BibLayer.cs" />
<Compile Include="Traits\World\SmudgeLayer.cs" />
@@ -279,9 +277,6 @@
<ItemGroup>
<Content Include="OpenRA.ico" />
</ItemGroup>
<ItemGroup>
<Folder Include="Traits\AI\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -22,8 +22,6 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Drawing;
using OpenRA.GameRules;
namespace OpenRA.Traits.Activities
{

View File

@@ -1,32 +0,0 @@
using System;
namespace OpenRA.Traits.Activities
{
public class Wait: IActivity
{
int remainingTicks;
public Wait (int period)
{
remainingTicks = period;
}
public IActivity Tick (Actor self)
{
if (remainingTicks-- == 0) return NextActivity;
return this;
}
public void Cancel (Actor self)
{
remainingTicks = 0; NextActivity = null;
}
public IActivity NextActivity { get; set; }
}
}

View File

@@ -19,8 +19,9 @@
#endregion
using System;
using OpenRA.Traits;
namespace OpenRA.Traits.Activities
namespace OpenRA.Mods.RA.Activities
{
public class CallFunc : IActivity
{

View File

@@ -0,0 +1,40 @@
#region Copyright & License Information
/*
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
* This file is part of OpenRA.
*
* OpenRA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenRA is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using OpenRA.Traits;
namespace OpenRA.Mods.RA.Activities
{
public class Wait : IActivity
{
int remainingTicks;
public Wait(int period) { remainingTicks = period; }
public IActivity Tick(Actor self)
{
if (remainingTicks-- == 0) return NextActivity;
return this;
}
public void Cancel(Actor self) { remainingTicks = 0; NextActivity = null; }
public IActivity NextActivity { get; set; }
}
}

View File

@@ -46,6 +46,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Activities\CallFunc.cs" />
<Compile Include="Activities\CaptureBuilding.cs" />
<Compile Include="Activities\DeliverOre.cs" />
<Compile Include="Activities\Demolish.cs" />
@@ -68,6 +69,7 @@
<Compile Include="Activities\Steal.cs" />
<Compile Include="Activities\Teleport.cs" />
<Compile Include="Activities\UnloadCargo.cs" />
<Compile Include="Activities\Wait.cs" />
<Compile Include="AirstrikePower.cs" />
<Compile Include="AttackFrontal.cs" />
<Compile Include="AttackHeli.cs" />