18 static void ReadLcf(rpg::MoveCommand& ref, LcfReader& stream, uint32_t length);
19 static void WriteLcf(
const rpg::MoveCommand& ref, LcfWriter& stream);
20 static int LcfSize(
const rpg::MoveCommand& ref, LcfWriter& stream);
21 static void WriteXml(
const rpg::MoveCommand& ref, XmlWriter& stream);
22 static void BeginXml(rpg::MoveCommand& ref, XmlReader& stream);
27 static void ReadLcf(std::vector<rpg::MoveCommand>& ref, LcfReader& stream, uint32_t length);
28 static void WriteLcf(
const std::vector<rpg::MoveCommand>& ref, LcfWriter& stream);
29 static int LcfSize(
const std::vector<rpg::MoveCommand>& ref, LcfWriter& stream);
30 static void WriteXml(
const std::vector<rpg::MoveCommand>& ref, XmlWriter& stream);
31 static void BeginXml(std::vector<rpg::MoveCommand>& ref, XmlReader& stream);
38 ref.command_id = stream.ReadInt();
39 const auto cmd =
static_cast<rpg::MoveCommand::Code
>(ref.command_id);
41 case rpg::MoveCommand::Code::switch_on:
42 stream.Read(ref.parameter_a);
44 case rpg::MoveCommand::Code::switch_off:
45 stream.Read(ref.parameter_a);
47 case rpg::MoveCommand::Code::change_graphic:
48 stream.ReadString(ref.parameter_string, stream.ReadInt());
49 stream.Read(ref.parameter_a);
51 case rpg::MoveCommand::Code::play_sound_effect:
52 stream.ReadString(ref.parameter_string, stream.ReadInt());
53 stream.Read(ref.parameter_a);
54 stream.Read(ref.parameter_b);
55 stream.Read(ref.parameter_c);
62 stream.WriteInt(ref.command_id);
63 const auto cmd =
static_cast<rpg::MoveCommand::Code
>(ref.command_id);
65 case rpg::MoveCommand::Code::switch_on:
66 stream.Write(ref.parameter_a);
68 case rpg::MoveCommand::Code::switch_off:
69 stream.Write(ref.parameter_a);
71 case rpg::MoveCommand::Code::change_graphic:
72 stream.WriteInt(stream.Decode(ref.parameter_string).size());
73 stream.Write(ref.parameter_string);
74 stream.Write(ref.parameter_a);
76 case rpg::MoveCommand::Code::play_sound_effect:
77 stream.WriteInt(stream.Decode(ref.parameter_string).size());
78 stream.Write(ref.parameter_string);
79 stream.Write(ref.parameter_a);
80 stream.Write(ref.parameter_b);
81 stream.Write(ref.parameter_c);
89 result += LcfReader::IntSize(ref.command_id);
90 const auto cmd =
static_cast<rpg::MoveCommand::Code
>(ref.command_id);
92 case rpg::MoveCommand::Code::switch_on:
93 result += LcfReader::IntSize(ref.parameter_a);
95 case rpg::MoveCommand::Code::switch_off:
96 result += LcfReader::IntSize(ref.parameter_a);
98 case rpg::MoveCommand::Code::change_graphic:
99 result += LcfReader::IntSize(stream.Decode(ref.parameter_string).size());
100 result += stream.Decode(ref.parameter_string).size();
101 result += LcfReader::IntSize(ref.parameter_a);
103 case rpg::MoveCommand::Code::play_sound_effect:
104 result += LcfReader::IntSize(stream.Decode(ref.parameter_string).size());
105 result += stream.Decode(ref.parameter_string).size();
106 result += LcfReader::IntSize(ref.parameter_a);
107 result += LcfReader::IntSize(ref.parameter_b);
108 result += LcfReader::IntSize(ref.parameter_c);
116 stream.BeginElement(
"MoveCommand");
117 stream.WriteNode(
"command_id", ref.command_id);
118 const auto cmd =
static_cast<rpg::MoveCommand::Code
>(ref.command_id);
120 case rpg::MoveCommand::Code::switch_on:
121 stream.WriteNode(
"parameter_a", ref.parameter_a);
123 case rpg::MoveCommand::Code::switch_off:
124 stream.WriteNode(
"parameter_a", ref.parameter_a);
126 case rpg::MoveCommand::Code::change_graphic:
127 stream.WriteNode(
"parameter_string", ref.parameter_string);
128 stream.WriteNode(
"parameter_a", ref.parameter_a);
130 case rpg::MoveCommand::Code::play_sound_effect:
131 stream.WriteNode(
"parameter_string", ref.parameter_string);
132 stream.WriteNode(
"parameter_a", ref.parameter_a);
133 stream.WriteNode(
"parameter_b", ref.parameter_b);
134 stream.WriteNode(
"parameter_c", ref.parameter_c);
138 stream.EndElement(
"MoveCommand");