some basic plane behavior on Yak
This commit is contained in:
32
OpenRa.Game/Traits/Plane.cs
Normal file
32
OpenRa.Game/Traits/Plane.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OpenRa.Game.Traits.Activities;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class Plane : IOrder
|
||||
{
|
||||
public Plane(Actor self)
|
||||
{
|
||||
}
|
||||
|
||||
public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor)
|
||||
{
|
||||
if (mi.Button == MouseButton.Left) return null;
|
||||
if (underCursor == null)
|
||||
return Order.Move(self, xy);
|
||||
return null;
|
||||
}
|
||||
|
||||
public void ResolveOrder(Actor self, Order order)
|
||||
{
|
||||
if (order.OrderString == "Move")
|
||||
{
|
||||
self.CancelActivity();
|
||||
self.QueueActivity(new Circle(order.TargetLocation));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user