public CommandButton(CommandButtonType type) : base(Rectangle.Empty) { NormalTexture = type.Texture; Type = type; Hotkey = type.Hotkey; }
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; } }
public ScheduledStructureCommand(float scheduledTime, Structure structure, CommandButtonType commandType, short id) : base(scheduledTime) { Structure = structure; CommandType = commandType; ID = id; Index = -1; }
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); }
public ScheduledStructureCommand(float scheduledTime, Structure structure, CommandButtonType commandType, short id) : base(scheduledTime) { Structure = structure; CommandType = commandType; ID = id; }
public ScheduledStructureTargetedCommand(float scheduledTime, Structure structure, CommandButtonType commandType, BaseObject target, Vector2 point, bool queued) : base(scheduledTime, structure, commandType) { Target = target; Point = point; Queued = queued; }