public static DoMovementCommand read(BinaryReader binaryReader) { DoMovementCommand newObj = new DoMovementCommand(); newObj.i_motion = binaryReader.ReadUInt32(); Util.readToAlign(binaryReader); newObj.i_speed = binaryReader.ReadSingle(); Util.readToAlign(binaryReader); newObj.i_hold_key = (HoldKey)binaryReader.ReadUInt32(); Util.readToAlign(binaryReader); return(newObj); }
public override bool acceptMessageData(BinaryReader messageDataReader, TreeView outputTreeView) { bool handled = true; PacketOpcode opcode = Util.readOpcode(messageDataReader); switch (opcode) { // TODO: PacketOpcode.Evt_Movement__PositionAndMovement_ID case PacketOpcode.Evt_Movement__Jump_ID: { Jump message = Jump.read(messageDataReader); message.contributeToTreeView(outputTreeView); break; } case PacketOpcode.Evt_Movement__MoveToState_ID: { MoveToState message = MoveToState.read(messageDataReader); message.contributeToTreeView(outputTreeView); break; } case PacketOpcode.Evt_Movement__DoMovementCommand_ID: { DoMovementCommand message = DoMovementCommand.read(messageDataReader); message.contributeToTreeView(outputTreeView); break; } // TODO: PacketOpcode.Evt_Movement__TurnEvent_ID // TODO: PacketOpcode.Evt_Movement__TurnToEvent_ID case PacketOpcode.Evt_Movement__StopMovementCommand_ID: { StopMovementCommand message = StopMovementCommand.read(messageDataReader); message.contributeToTreeView(outputTreeView); break; } case PacketOpcode.Evt_Movement__UpdatePosition_ID: { UpdatePosition message = UpdatePosition.read(messageDataReader); message.contributeToTreeView(outputTreeView); break; } case PacketOpcode.Evt_Movement__MovementEvent_ID: { MovementEvent message = MovementEvent.read(messageDataReader); message.contributeToTreeView(outputTreeView); break; } case PacketOpcode.Evt_Movement__AutonomyLevel_ID: { AutonomyLevel message = AutonomyLevel.read(messageDataReader); message.contributeToTreeView(outputTreeView); break; } case PacketOpcode.Evt_Movement__AutonomousPosition_ID: { AutonomousPosition message = AutonomousPosition.read(messageDataReader); message.contributeToTreeView(outputTreeView); break; } case PacketOpcode.Evt_Movement__Jump_NonAutonomous_ID: { Jump_NonAutonomous message = Jump_NonAutonomous.read(messageDataReader); message.contributeToTreeView(outputTreeView); break; } default: { handled = false; break; } } return(handled); }