示例#1
0
 public CommandButton(CommandButtonType type)
     : base(Rectangle.Empty)
 {
     NormalTexture = type.Texture;
     Type = type;
     Hotkey = type.Hotkey;
 }
示例#2
0
        void processStructureCommand(NetIncomingMessage msg)
        {
            float scheduledTime = msg.ReadFloat();
            short team          = msg.ReadInt16();
            short structureID   = msg.ReadInt16();
            short commandTypeID = msg.ReadInt16();
            short unitID        = msg.ReadInt16();
            short index         = msg.ReadInt16();

            Structure         structure   = Player.Players[team].StructureArray[structureID];
            CommandButtonType commandType = CommandButtonType.CommandButtonTypes[commandTypeID];

            if (structure == null)
            {
                int wut = 0;
            }

            if (index >= 0)
            {
                ScheduledStructureCommand command = new ScheduledStructureCommand(scheduledTime, structure, commandType);
                command.Index = index;
                Player.Players[team].ScheduledActions.Add(command);
            }
            else
            {
                Player.Players[team].ScheduledActions.Add(new ScheduledStructureCommand(scheduledTime, structure, commandType, unitID));
            }

            if (unitID >= 0)
            {
                Player.Players[team].UnitArray[unitID] = Unit.Reserved;
            }
        }
示例#3
0
 public CommandButton(CommandButtonType type)
     : base(Rectangle.Empty)
 {
     NormalTexture = type.Texture;
     Type          = type;
     Hotkey        = type.Hotkey;
 }
示例#4
0
 public ScheduledStructureCommand(float scheduledTime, Structure structure, CommandButtonType commandType, short id)
     : base(scheduledTime)
 {
     Structure   = structure;
     CommandType = commandType;
     ID          = id;
     Index       = -1;
 }
示例#5
0
        public void TransmitStructureCommand(Structure s, CommandButtonType commandType, short unitID = short.MinValue, short index = short.MinValue)
        {
            NetOutgoingMessage msg = netPeer.CreateMessage();

            msg.Write(MessageID.STRUCTURE_COMMAND);
            msg.Write(currentScheduleTime);
            msg.Write(s.Team);
            msg.Write(s.ID);
            msg.Write(commandType.ID);
            msg.Write(unitID);
            msg.Write(index);

            netPeer.SendMessage(msg, connection, NetDeliveryMethod.ReliableOrdered);
        }
示例#6
0
 public ScheduledStructureCommand(float scheduledTime, Structure structure, CommandButtonType commandType, short id)
     : base(scheduledTime)
 {
     Structure = structure;
     CommandType = commandType;
     ID = id;
 }
示例#7
0
 public ScheduledStructureTargetedCommand(float scheduledTime, Structure structure, CommandButtonType commandType, BaseObject target, Vector2 point, bool queued)
     : base(scheduledTime, structure, commandType)
 {
     Target = target;
     Point = point;
     Queued = queued;
 }
示例#8
0
 public ScheduledStructureTargetedCommand(float scheduledTime, Structure structure, CommandButtonType commandType, BaseObject target, Vector2 point, bool queued)
     : base(scheduledTime, structure, commandType)
 {
     Target = target;
     Point  = point;
     Queued = queued;
 }