#pragma once /** * \file Commands.h * \brief File containing the definitions of the lockstep commands */ #include #include #include #include #include #include #include #include #include namespace td { namespace protocol { /** A Command id is 8 bits wide */ enum class CommandID : std::uint8_t { End = 0, PlaceTower, PlayerJoin, SpawnTroop, TeamChange, UpgradeTower, UseItem, }; class CommandHandler; using CommandBase = sp::MessageBase; template using CommandMessage = sp::ConcreteMessage; namespace commands { using EndCommand = CommandMessage; using PlaceTowerCommand = CommandMessage; using PlayerJoinCommand = CommandMessage; using SpawnTroopCommand = CommandMessage; using TeamChangeCommand = CommandMessage; using UpgradeTowerCommand = CommandMessage; using UseItemCommand = CommandMessage; } // namespace commands using AllCommands = std::tuple; class CommandHandler : public sp::GenericHandler {}; using CommandDispatcher = sp::MessageDispatcher; using CommandFactory = sp::MessageFactory; using CommandPtr = sp::SerializableMessage; using LockStep = std::vector; } // namespace protocol } // namespace td