Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Misc > Archive::Off Topic

Archive::Off Topic Archive area for Off Topic's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #12  
Old 09-05-2004, 07:30 PM
Charmy
Discordant
 
Join Date: May 2004
Location: The DeathStar of David
Posts: 337
Default

So a game your making?

If its your game i take it you wrote the code?


Sadly i have no life at this time in the moring, and when i can't sleep i wander the internet looking at hawt male porn and searching for answers, and in my quest i found the following.

Code:
// Purpose: messages travel both up and down the layers,
//          message interface per layer per direction,
//          one concrete Facade per layer (implements 1 or 2 interfaces)
//          Singleton access to Facade objects

#include <iostream>
using namespace std;

class ChildOf3  { public: virtual void downMessage() = 0; };
class ParentOf2 { public: virtual void upMessage()   = 0; };
class ChildOf2  { public: virtual void downMessage() = 0; };
class ParentOf1 { public: virtual void upMessage()   = 0; };

class C : public ParentOf2 { public:
   void execute();
   void upMessage();
};
class B : public ParentOf1, public ChildOf3 { public:
   void upMessage();
   void downMessage();
};
class A : public ChildOf2 { public:
   void downMessage();
   void execute();
};

class SC {   // Singleton Collection
public:
   static C& layer3() { return cObject; }
   static B& layer2() { return bObject; }
   static A& layer1() { return aObject; }
private:
   static C cObject;  static B bObject;  static A aObject;
};
   C SC::cObject;     B SC::bObject;     A SC::aObject;

void thirdParty( ChildOf2& obj1, ChildOf3& obj2, ParentOf2& obj3 ) {
   obj1.downMessage();
   obj2.downMessage();
   obj3.upMessage();
}

void main( void ) {
   SC::layer3().execute();
   SC::layer1().execute();
   thirdParty( SC::layer1(), SC::layer2(), SC::layer3() );
}

// C::execute          // A::execute        // A::downMessage
// B::downMessage      // B::upMessage      // B::downMessage
// A::downMessage      // C::upMessage      // A::downMessage
                                            // C::upMessage

void C::execute()     { cout << "C::execute" << endl;
                        SC::layer2().downMessage(); }
void C::upMessage()   { cout << "C::upMessage" << endl; }

void B::upMessage()   { cout << "B::upMessage" << endl;
                        SC::layer3().upMessage(); }
void B::downMessage() { cout << "B::downMessage" << endl;
                        SC::layer1().downMessage(); }

void A::execute()     { cout << "A::execute" << endl;
                        SC::layer2().upMessage(); }
void A::downMessage() { cout << "A::downMessage" << endl; }
looks familiar....

http://home.earthlink.net/~huston2/dp/layersCpp
http://home.earthlink.net/~huston2/d...nsionObjectCpp

Really, don't take credit for other ppls work, its not cool, infact in all of the code network sites they say if you use this code give credit where credit is due =/ you just went and ripped this off. that or you were trying to retype it with about a 1% accuracy.

The only other thing i can think of is you were taking a tutorial from this site or somthing, and got confused somewhere.

**Just a note, before you go and say this is your friends site you might want to double check what you wrote up a little earlier about only 1/10 of this code being written by him.**

I am not one to usually bring this up, but if there is one thing being a jew has taught me its don't take credit for shit you didn't do, it just pisses people off.

And Finally
Quote:
Characters Charmy........
As if its suppose to be obvious using variable names like objectA, ParentB and ChildC? errm.....
__________________
Mess with the Jews, and we will take all your money
Grunties Rule
And with that... I end
Any Other Questions, please refer to the Following:
http://iliilllli1.netfirms.com
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 01:03 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3