Skip to content

Instantly share code, notes, and snippets.

@chrivers
Created September 29, 2016 10:32
Show Gist options
  • Save chrivers/5d15b2897daf4cd5da11df0190f3e34a to your computer and use it in GitHub Desktop.
Save chrivers/5d15b2897daf4cd5da11df0190f3e34a to your computer and use it in GitHub Desktop.
// all cases are unit enums
pub enum ServerPacket
{
AllShipSettings(AllShipSettingsPacket),
BeamFired(BeamFiredPacket),
CommsIncoming(CommsIncomingPacket),
ConsoleStatus(ConsoleStatusPacket),
DestroyObject(DestroyObjectPacket),
Difficulty(DifficultyPacket),
DmxMessage(DmxMessagePacket),
// ....
}
// all cases are struct enums
pub enum ServerPacket
{
AllShipSettings
{
/// A list of the eight available player ships. Each ship is structured as
/// follows:
ships: [Ship; 8],
},
BeamFired
{
/// A unique identifier for this beam. Each time a beam is fired, it gets
/// its own ID.
id: i32,
/// All ships that can fire beams have beam ports. These are defined in
/// vesselData.xml as <beam_port> entries. This value gives the index of
/// the beam port on the originating ship that fired the beam. This value
/// is zero-based; thus, vessels that only have one beam port will always
/// give 0 for this value.
beam_port_index: i32,
// ...
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment