![]() |
SmallHandler Class ReferenceSmall mud socket handler controller class. More...
Collaboration diagram for SmallHandler: ![]()
Detailed DescriptionSmall mud socket handler controller class.
Definition at line 34 of file SmallHandler.h. Constructor & Destructor Documentation
Member Function Documentation
Definition at line 42 of file SmallHandler.cpp. 00043 { 00044 for (socket_m::iterator it = m_sockets.begin(); it != m_sockets.end(); it++) 00045 { 00046 Socket *p0 = (*it).second; 00047 SmallSocket *p = dynamic_cast<SmallSocket *>(p0); 00048 if (p) 00049 { 00050 p2 -> Send(p -> GetName() + "\n"); 00051 } 00052 } 00053 }
Definition at line 75 of file SmallHandler.cpp. References World::GetAt(), m_itemf, m_mob, m_world, ItemFactory::ShowNamesAt(), and MobFactory::ShowNamesAt(). 00076 { 00077 int x = p -> GetX(); 00078 int y = p -> GetY(); 00079 std::string name; 00080 bool n,s,e,w; 00081 m_world.GetAt(x,y,name,n,s,e,w); 00082 p -> Send(name + "\n"); 00083 m_mob.ShowNamesAt(p,x,y,"Here is "); 00084 m_itemf.ShowNamesAt(p,x,y,"You see "); 00085 /* 00086 if (n && m_world.FindAt(x,y - 1,name)) 00087 { 00088 p -> Send("To the north you see... " + name + "\n"); 00089 m_mob.ShowNamesAt(p,x,y - 1); 00090 m_itemf.ShowNamesAt(p,x,y - 1); 00091 } 00092 if (s && m_world.FindAt(x,y + 1,name)) 00093 { 00094 p -> Send("To the south you see... " + name + "\n"); 00095 m_mob.ShowNamesAt(p,x,y + 1); 00096 m_itemf.ShowNamesAt(p,x,y + 1); 00097 } 00098 if (e && m_world.FindAt(x + 1,y,name)) 00099 { 00100 p -> Send("To the east you see... " + name + "\n"); 00101 m_mob.ShowNamesAt(p,x + 1,y); 00102 m_itemf.ShowNamesAt(p,x + 1,y); 00103 } 00104 if (w && m_world.FindAt(x - 1,y,name)) 00105 { 00106 p -> Send("To the west you see... " + name + "\n"); 00107 m_mob.ShowNamesAt(p,x - 1,y); 00108 m_itemf.ShowNamesAt(p,x - 1,y); 00109 } 00110 */ 00111 std::string str = "Exits:&W"; 00112 str += n ? " N" : ""; 00113 str += s ? " S" : ""; 00114 str += e ? " E" : ""; 00115 str += w ? " W" : ""; 00116 p -> Send( str + "&n\n"); 00117 }
Definition at line 56 of file SmallHandler.cpp. References m_itemf, m_mob, MobFactory::RandomAction(), MobFactory::Spawn(), and ItemFactory::Spawn(). Referenced by main(). 00057 { 00058 if (random() % 5 == 0) 00059 { 00060 m_itemf.Spawn(); 00061 } 00062 else 00063 if (random() % 120 == 0) 00064 { 00065 m_mob.Spawn(); 00066 } 00067 else 00068 if (random() % 5 == 0) 00069 { 00070 m_mob.RandomAction(); 00071 } 00072 }
Definition at line 44 of file SmallHandler.h. References m_world. Referenced by MobFactory::MOB::Create(), MobFactory::MOB::Move(), MobFactory::Spawn(), and ItemFactory::Spawn(). 00044 { return m_world; }
Definition at line 148 of file SmallHandler.cpp. References m_itemf, m_mob, m_world, World::NumberOfCells(), ItemFactory::NumberOfItems(), and MobFactory::NumberOfMobs(). 00149 { 00150 sendto -> Send("Number of rooms : &R" + Utility::l2string(m_world.NumberOfCells()) + "&n\n"); 00151 sendto -> Send("Number of mobs : &G" + Utility::l2string(m_mob.NumberOfMobs()) + "&n\n"); 00152 sendto -> Send("Number of items : &B" + Utility::l2string(m_itemf.NumberOfItems()) + "&n\n"); 00153 }
Definition at line 120 of file SmallHandler.cpp. Referenced by ItemFactory::Spawn(). 00121 { 00122 for (socket_m::iterator it = m_sockets.begin(); it != m_sockets.end(); it++) 00123 { 00124 Socket *p0 = (*it).second; 00125 SmallSocket *p = dynamic_cast<SmallSocket *>(p0); 00126 if (p && p != from) 00127 { 00128 if (bAll || p -> IsAt(x,y)) 00129 { 00130 p -> Send("\n" + line); 00131 p -> SendPrompt(); 00132 } 00133 } 00134 } 00135 }
Member Data Documentation
Definition at line 55 of file SmallHandler.h. Referenced by GetWorld(), ShowCell(), and ShowStatus().
Definition at line 56 of file SmallHandler.h. Referenced by SecTick(), ShowCell(), and ShowStatus().
Definition at line 59 of file SmallHandler.h. Referenced by GetItems(), MergeItem(), SecTick(), ShowCell(), and ShowStatus().
The documentation for this class was generated from the following files: |