/* ==================== msg_port.cpp ==================== */ #include "msg_port.h" MsgPort::MsgPort(Pod* in_pod) { from = in_pod; } MsgPort::~MsgPort() { /* do nothing */ } void MsgPort::Send(Pod* to, message msg) { switch(msg) { case MSG_ATTACK: { // give the other pod a chance to decide to attack to->PromptEngagement(from); /* // my engagement int e = to->GetEngage(); // if i'm supposed to fight anybody: if (e == 0) { PointerHub::GetRenderMan()->StartCombat(from, to); } else if (e == 1) { // fight if he is bigger than me if (to->GetNumShapes() >= from->GetNumShapes()) { PointerHub::GetRenderMan()->StartCombat(from, to); } } else if (e == 2) { // fight if he is smaller than me if (to->GetNumShapes() <= from->GetNumShapes()) { PointerHub::GetRenderMan()->StartCombat(from, to); } } */ break; } default: ;; // do nothing // fall } }