resonance 1.0.1
Loading...
Searching...
No Matches
controllercmd.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4
6#include "sch/command.h"
7
8class IBStream;
9class OBStream;
10
31public:
38 }
39
48 explicit ControllerCmd(const MetControllerReading &reading) : mReading(reading) {
49 }
50
58 virtual int CmdID();
59
66 virtual void Execute();
67
75 virtual void Print(std::ostream &stream);
76
84 virtual void saveGuts(OBStream &stream) const;
85
93 virtual void restoreGuts(IBStream &stream);
94
101 static int sCmdID;
102
103private:
104 MetControllerReading mReading; // +0x0c
105};
106
virtual void restoreGuts(IBStream &stream)
Read the reading back, discarding the three tag bytes on each side.
static int sCmdID
Identifier the class streams itself under.
Definition controllercmd.h:101
virtual int CmdID()
Report the identifier this class streams itself under.
ControllerCmd(const MetControllerReading &reading)
Record one controller reading to replay.
Definition controllercmd.h:48
virtual void Execute()
Hand the reading to the world of the running game.
virtual void saveGuts(OBStream &stream) const
Write the reading between the tags CM[ and ]CM.
virtual void Print(std::ostream &stream)
Write {ControllerCmd} to a diagnostic stream.
ControllerCmd()
Start with the reading unset.
Definition controllercmd.h:37
Input half of the byte stream interface.
Definition ibstream.h:36
One controller reading, as RawControllerMsg carries it.
Definition metcontrollerreading.h:24
Output half of the byte stream interface.
Definition obstream.h:25
Base of every action the scheduler performs on behalf of another subsystem.
Definition command.h:60
Sch::Command * NewControllerCmd()
Produce a ControllerCmd with the reading unset, for the stream to load into.