Thing –|—————————–|
(id, uid, name, description, location, contents, movement, lua, command interp)
| |
Creature Object
(Attributes, Other stats) |
| (object stats)
Brain Item —– House —— Terrain —– Other
(Handler, Saving)
|
Human Brain —————- MonsterBrain
| |
Socket Combat Routines
| |
Player Only Data Monster Only Data
void CmdMssp( IBrain *apBrain, std::string &arCommand, std::string &arArgument )In most cases I don't care what type of Brain or Thing it is though.
{
if ( apBrain != NULL && apBrain->GetType() == IBrain::eHUMAN )
{
// Send the request for MSSP variable/s to the HumanBrain.
(dynamic_cast<IHumanBrain*>(apBrain))->PutMssp(arArgument);
}
}
That is what I do - the Brain provides the common interface, so that the Thing can send and receive data to and from the Brain, regardless of whether it's using a socket or an AI module.
I would love to see some more in depth examples of this; eg how you handle input from ai opposed to players etc ;)