Moved Activity and friends into separate files.

This commit is contained in:
Bob
2009-11-02 20:22:12 +13:00
parent 279f13bc5b
commit ddc91ddafa
9 changed files with 400 additions and 372 deletions

View File

@@ -1,9 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenRa.Game.Traits;
using OpenRa.Game.GameRules;
using OpenRa.Game.Traits;
namespace OpenRa.Game
{
@@ -17,7 +16,7 @@ namespace OpenRa.Game
{
var mobile = order.Subject.traits.Get<Mobile>();
mobile.Cancel( order.Subject );
mobile.QueueActivity( new Mobile.MoveTo( order.TargetLocation ) );
mobile.QueueActivity( new Traits.Activities.Move( order.TargetLocation ) );
var attackBase = order.Subject.traits.WithInterface<AttackBase>().FirstOrDefault();
if( attackBase != null )
@@ -37,7 +36,7 @@ namespace OpenRa.Game
var range = Rules.WeaponInfo[ weapon ].Range;
mobile.QueueActivity(
new Mobile.MoveTo( order.TargetActor,
new Traits.Activities.Move( order.TargetActor,
Math.Max( 0, (int)range - RangeTolerance ) ) );
}
@@ -50,7 +49,7 @@ namespace OpenRa.Game
break; /* throw the order on the floor */
var mobile = order.Subject.traits.Get<Mobile>();
mobile.QueueActivity( new Mobile.Turn( 96 ) );
mobile.QueueActivity( new Traits.Activities.Turn( 96 ) );
mobile.QueueActivity( new Traits.Activities.DeployMcv() );
break;
}
@@ -58,8 +57,8 @@ namespace OpenRa.Game
{
var mobile = order.Subject.traits.Get<Mobile>();
mobile.Cancel(order.Subject);
mobile.QueueActivity(new Mobile.MoveTo(order.TargetActor.Location + new int2(1, 2)));
mobile.QueueActivity(new Mobile.Turn(64));
mobile.QueueActivity( new Traits.Activities.Move( order.TargetActor.Location + new int2( 1, 2 ) ) );
mobile.QueueActivity( new Traits.Activities.Turn( 64 ) );
/* todo: actual deliver activity! [animation + add cash] */
break;