Repository navigation
eolib v0.1.0-beta.5
Pre-release
Pre-release
·
4 commits
to master
since this release
Added
- Generated
For<Case>static factories on structs and packets with switches, which set the switch field and its data together, e.g.LoginReplyServerPacket::ForOk(data)andLoginReplyServerPacket::ForWrongUser(). Nested switches are flattened onto the top-level class (InitInitServerPacket::ForBannedTemporary(data)), integer cases with data are named after their case class (ForBanTypeData0(data)), and default cases take the switch value (AccountReplyServerPacket::ForReplyCodeDefault(code, data), which throwsstd::invalid_argumentfor values with their own case). - Generated
As<Case>()accessors for switch data, which return a pointer to the case data ornullptrif the switch holds data for a different case, e.g.packet.AsOk()andpacket.AsBanned()->AsTemporary().