#pragma once #include #include #include #include "ConversationCommand.h" namespace conversation { /** * Data object representing a single Conversation. */ class Conversation { public: // The (unique) name of this conversation std::string name; float talkDistance; bool actorsMustBeWithinTalkdistance; bool actorsAlwaysFaceEachOther; int maxPlayCount; // Indexed list of commands typedef std::map CommandMap; CommandMap commands; // Indexed list of actors (by name) typedef std::map ActorMap; ActorMap actors; // Constructor Conversation() : talkDistance(60), actorsMustBeWithinTalkdistance(true), actorsAlwaysFaceEachOther(true), maxPlayCount(-1) {} // Copy Constructor Conversation(const Conversation& other) : name(other.name), talkDistance(other.talkDistance), actorsMustBeWithinTalkdistance(other.actorsMustBeWithinTalkdistance), actorsAlwaysFaceEachOther(other.actorsAlwaysFaceEachOther), maxPlayCount(other.maxPlayCount), actors(other.actors) { // Copy all commands, one by one for (CommandMap::const_iterator i = other.commands.begin(); i != other.commands.end(); ++i) { // Copy-construct a new conversation command ConversationCommandPtr copy(new ConversationCommand(*i->second)); // Insert this into our own map commands[i->first] = copy; } } }; /** * Conversation map type. */ typedef std::map ConversationMap; }