示例#1
0
        public MinimapPingAction(int sequence, int frame, IPlayer player, IMapPosition mapPosition)
            : base(sequence, frame, player)
        {
            this.MapPosition = mapPosition;

            ActionType = ActionType.MinimapPing;
        }
        private BuildAction ParseBuildAction()
        {
            IMapPosition mapPosition = ParseMapPosition();
            OrderType    orderType   = (OrderType)_input.ReadByte();
            ObjectType   objectType  = (ObjectType)_input.ReadShort();

            return(new BuildAction(sequence, frame, player, orderType, mapPosition, objectType));
        }
示例#3
0
        public bool Equals(IMapPosition b)
        {
            if (!(b is Vertex))
            {
                return(false);
            }

            return(Equals((Vertex)b));
        }
示例#4
0
        public float Cost(IMapPosition parent)
        {
            var Other = (MapPosition)parent;
            int dx    = (X - Other.X);
            int dy    = (Y - Other.Y);
            int dz    = (Z - Other.Z);

            return((float)Math.Sqrt(dx * dx + dy * dy + dz * dz));
        }
示例#5
0
        public float Cost(IMapPosition position)
        {
            if (position == null)
            {
                return(0);
            }

            return(Heuristic(this, (Vertex)position));
        }
        private TargetAction ParseTargetAction()
        {
            IMapPosition position   = ParseMapPosition();
            int          objectId   = _input.ReadUnsignedShort();
            OrderType    orderType  = (OrderType)_input.ReadByte();
            ObjectType   objectType = (ObjectType)_input.ReadShort();
            QueueType    queueType  = (QueueType)_input.ReadByte();

            return(new TargetAction(sequence, frame, player, position, objectId, objectType, orderType, queueType));
        }
        private RightClickAction ParseRightClickAction()
        {
            IMapPosition mapPosition = ParseMapPosition();

            short      memoryId   = _input.ReadShort();
            ObjectType objectType = (ObjectType)_input.ReadShort();
            QueueType  queueType  = (QueueType)_input.ReadByte();

            return(new RightClickAction(sequence, frame, player, mapPosition, memoryId, objectType, queueType));
        }
示例#8
0
        public bool Equals(IMapPosition b)
        {
            if (!(b is MapPosition))
            {
                return(false);
            }
            var Comp = (MapPosition)b;

            return(Comp.X == X && Comp.Y == Y && Comp.Z == Z);
        }
示例#9
0
        public BuildAction(int sequence, int frame, IPlayer player, OrderType orderType,
                           IMapPosition mapPosition, ObjectType objectType)
            : base(sequence, frame, player)
        {
            this.OrderType   = orderType;
            this.MapPosition = mapPosition;
            this.ObjectType  = objectType;

            ActionType = ActionType.Build;
        }
示例#10
0
        public RightClickAction(int sequence, int frame, IPlayer player,
                                IMapPosition mapPosition, short memoryId,
                                ObjectType objectType, QueueType queueType)
            : base(sequence, frame, player)
        {
            this.MapPosition      = mapPosition;
            this.MemoryIdentifier = memoryId;
            this.ObjectType       = objectType;
            this.QueueType        = queueType;

            ActionType = ActionType.RightClick;
        }
示例#11
0
        public TargetAction(int sequence, int frame, IPlayer player, 
            IMapPosition mapPosition, int objectId, 
            ObjectType objectType, OrderType orderType, 
            QueueType queueType)
            : base(sequence, frame, player)
        {
            this.MapPosition = mapPosition;
            this.ObjectIdentifier = objectId;
            this.ObjectType = objectType;
            this.OrderType = orderType;
            this.QueueType = queueType;

            ActionType = ActionType.Target;
        }
示例#12
0
        public TargetAction(int sequence, int frame, IPlayer player,
                            IMapPosition mapPosition, int objectId,
                            ObjectType objectType, OrderType orderType,
                            QueueType queueType)
            : base(sequence, frame, player)
        {
            this.MapPosition      = mapPosition;
            this.ObjectIdentifier = objectId;
            this.ObjectType       = objectType;
            this.OrderType        = orderType;
            this.QueueType        = queueType;

            ActionType = ActionType.Target;
        }
示例#13
0
 public LiftAction(int sequence, int frame, IPlayer player, IMapPosition mapPosition)
     : base(sequence, frame, player)
 {
     MapPosition = mapPosition;
     ActionType  = ActionType.Lift;
 }
        private MinimapPingAction ParseMinimapPingAction()
        {
            IMapPosition mapPosition = ParseMapPosition();

            return(new MinimapPingAction(sequence, frame, player, mapPosition));
        }
        private LiftAction ParseLiftAction()
        {
            IMapPosition position = ParseMapPosition();

            return(new LiftAction(sequence, frame, player, position));
        }