Advertisement
jolievivienne

Class accessing Class

Jun 9th, 2015
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 9.82 KB | None | 0 0
  1. class ExistenceClient : public ExistenceApp
  2. {
  3.     OBJECT(ExistenceClient);
  4.  
  5. public:
  6.  
  7.  
  8.     /// Construct.
  9.     ExistenceClient(Context* context);
  10.     virtual ~ExistenceClient();
  11.  
  12.     /// Setup after engine initialization and before running the main loop.
  13.     virtual void Start();
  14.  
  15.     /// Return XML patch instructions for screen joystick layout for a specific sample app, if any.https://github.com/urho3d/Urho3D/tree/master/Source/Samples
  16.     virtual String GetScreenJoystickPatchString() const
  17.     {
  18.         return
  19.             "<patch>"
  20.             "    <add sel=\"/element/element[./attribute[@name='Name' and @value='Hat0']]\">"
  21.             "        <attribute name=\"Is Visible\" value=\"false\" />"
  22.             "    </add>"
  23.             "</patch>";
  24.     }
  25.  
  26.     void Init(Context * context);
  27.  
  28.     /// Diaplay login screen
  29.     void SetupScreenViewport(void);
  30.     void SetupScreenUI(void);
  31.  
  32.     /// Subscribe to application-wide logic update events.
  33.     void SubscribeToEvents();
  34.     /// Handle the logic update event.
  35.     void HandleUpdate(StringHash eventType, VariantMap& eventData);
  36.     /// Events Keyboard
  37.     void HandleKeyDown(StringHash eventType, VariantMap& eventData);
  38.  
  39.     void HandleInput(const String& input);
  40.     void eraseScene(void);
  41.  
  42.     void AddLogoViewport(void);
  43.  
  44.     int CreateCursor(void);
  45.  
  46.     void MoveCamera(float timeStep);
  47.     void Print(const String& output);
  48.  
  49.     void HandlePostUpdates(StringHash eventType, VariantMap& eventData);
  50.  
  51.     /// Render related functions
  52.     int LoadCharacterMesh(int mode, String nodename, unsigned int alienrace, unsigned int gender);
  53.     int loadplayerMesh(Node * playermeshNode, int alienrace, int gender,int mode);
  54.  
  55.     /// File related functions
  56.     void LoadAccount(void);
  57.     void SaveAccount(accountinformation account);
  58.     void SavePlayer(bool activeplayer);
  59.     int LoadAccountPlayers(void);
  60.     int LoadPlayer(int player) ;
  61.     int LoadTemporaryPlayer(int player);
  62.     int GenerateSceneLoadDifferential(const char *filename=NULL);
  63.     int LoadEnvironmentSettings(const char *environment);
  64.  
  65.     /// Console related functions
  66.     void InitializeConsole(void);
  67.     void HandleConsoleCommand(StringHash eventType, VariantMap& eventData);
  68.  
  69.     int ConsoleActionEnvironment(const char * lineinput);
  70.     int ConsoleActionCamera(const char * lineinput);
  71.     int ConsoleActionDebug(const char * lineinput);
  72.     int ConsoleActionCharacter(const char * lineinput);
  73.     int ConsoleActionRenderer(const char * lineinput);
  74.     int ConsoleActionBuild(const char * lineinput);
  75.  
  76.     /// UI Related Functions
  77.     void loadSceneUI(void);
  78.     bool loadHUDFile(const char * filename, const int positionx, const int positiony);
  79.     void loadUIXMLClosePressed(StringHash eventType, VariantMap& eventData);
  80.     bool loadUIXML(int windowtype, const int positionx, const int positiony, int selected);
  81.     void QuickMenuPressed(StringHash eventType, VariantMap& eventData);
  82.     void UpdateUI(float timestep);
  83.     void PlayerWindowUpdateUI(int selected);
  84.     void PlayerWindowHandleDisplaySelection(StringHash eventType, VariantMap& eventData);
  85.     int UpdateUISceneLoader(void);
  86.     void UpdatePlayerInfoBar(void);
  87.     void SceneLoaderHanderPress(StringHash eventType, VariantMap& eventData);
  88.     int GenerateSceneUpdateEnvironment(terrain_rule terrainrule);
  89.  
  90.     /// Temporary online
  91.     bool IsClientConnected(void);
  92.     bool ClientConnect(void);
  93.     bool SetServerSettings(void);
  94.  
  95.     /// Get subsubsystems
  96.     Renderer * GetRenderSubsystems(void) const;
  97.     UI * GetUISubsystems(void) const;
  98.     Graphics * GetGraphicsSubsystems(void) const;
  99.     ResourceCache * GetResourceCacheSubsystems(void) const;
  100.  
  101.     Window * GetSharedWindow(void) const;
  102.  
  103.     int GetTestString(void)
  104.     {
  105.         return testvalue;
  106.     }
  107.  
  108.     friend class ExistenceClientStateMainScreen;
  109.  
  110. protected:
  111.     /// Urho3D window shared pointers
  112.     SharedPtr<Window> window_;
  113.     SharedPtr<Window> window2_;
  114.  
  115.     /// Urho3D UIelement root, viewport, and render path
  116.     SharedPtr<UIElement> uiRoot_;
  117.     SharedPtr<Viewport> viewport;
  118.  
  119.     SharedPtr<RenderPath> effectRenderPath;
  120.  
  121.     /// Urho3D Shared pointer for input
  122.     SharedPtr<Input> input_;
  123.  
  124.     /// Existence Weak pointer for a single character
  125.     WeakPtr<Character> character_;
  126.  
  127.  
  128.     /// Existence player structure class and variable declation for character/player related information
  129.     Player  TemporaryPlayer;
  130.     Player  * TemporaryAccountPlayerList;
  131.     unsigned int TemporaryAccountPlayerSelected;
  132.     unsigned int TemporaryAccountPlayerListLimit;
  133. http://www.themonitor.com/news/local/spacex-requests-more-wetlands-covered-for-rocket-launch-site-public/article_6dfe84de-0de6-11e5-a61d-930f216a22ef.html
  134.     /// Existence class and variable declaration for alien race alliance information
  135.     vector<string> aliensarray;
  136.     vector<string> tempaliensarray;
  137.  
  138.     /// This is temoporarily the necessary code
  139.     bool accountexist;
  140.  
  141.     /// Server connection related
  142.     bool ServerConnection;
  143.  
  144.     int testvalue;
  145.  
  146.  
  147. private:
  148.  
  149.  
  150. };
  151.  
  152. class ExistenceClient;
  153.  
  154. /// Login State
  155. class ExistenceClientStateSingleton : public LogicComponent
  156. {
  157.  
  158.     OBJECT(ExistenceClientStateSingleton);
  159. public:
  160.     ExistenceClientStateSingleton(Context * context);
  161.     virtual ~ExistenceClientStateSingleton();
  162.     virtual void Enter();
  163.     virtual void Exit();
  164.     virtual void OnUpdate(Urho3D::StringHash eventType, Urho3D::VariantMap& eventData );
  165. private:
  166.     void Singleton(void);
  167. protected:
  168.  
  169. };
  170.  
  171. /// Login State
  172. class ExistenceClientStateLogin : public ExistenceClientStateSingleton
  173. {
  174.     OBJECT(ExistenceClientStateLogin);
  175. public:
  176.     ExistenceClientStateLogin(Context * context);
  177.     virtual ~ExistenceClientStateLogin();
  178.     virtual void Enter();
  179.     virtual void Exit();
  180.     virtual void OnUpdate(Urho3D::StringHash eventType, Urho3D::VariantMap& eventData );
  181. private:
  182.     void LoginScreen(void);
  183.     void LoginScreenUI(void);
  184.     void LoginScreenUINewAccountHandleClosePressed(StringHash eventType, VariantMap& eventData);
  185.     void LoginScreenUILoginHandleClosePressed(StringHash eventType, VariantMap& eventData);
  186.  
  187. protected:
  188.  
  189. };
  190.  
  191. /// Account State
  192. class ExistenceClientStateAccount: public ExistenceClientStateSingleton
  193. {
  194.     OBJECT(ExistenceClientStateAccount);
  195. public:
  196.     ExistenceClientStateAccount(Context * context);
  197.     virtual ~ ExistenceClientStateAccount();
  198.     virtual void Enter();
  199.     virtual void Exit();
  200.     virtual void OnUpdate(Urho3D::StringHash eventType, Urho3D::VariantMap& eventData );
  201. private:
  202.     void Account(void);
  203.     void CreateAccountScreenUI(void);
  204.     void CreateAccountUIHandleClosePressed(StringHash eventType, VariantMap& eventData);
  205. protected:
  206.  
  207. };
  208.  
  209. /// Main Screen State
  210. class ExistenceClientStateMainScreen: public ExistenceClientStateSingleton
  211. {
  212.     OBJECT(ExistenceClientStateMainScreen);
  213.  
  214. public:
  215.     ExistenceClientStateMainScreen(Context * context);
  216.     virtual ~ExistenceClientStateMainScreen();
  217.     virtual void Enter();
  218.     virtual void Exit();
  219.     virtual void OnUpdate(Urho3D::StringHash eventType, Urho3D::VariantMap& eventData );
  220. private:
  221.     void MainScreen(void);
  222.     void MainScreenUI(void);
  223.     void MainScreenUIHandleClosePressed(StringHash eventType, VariantMap& eventData);
  224.     void HandleCharacterStartButtonReleased(StringHash eventType, VariantMap& eventData);
  225.     void HandleCharacterSelectedReleased(StringHash eventType, VariantMap& eventData);
  226.     void HandleCharacterSelectedInfoButtonReleased(StringHash eventType, VariantMap& eventData);
  227. protected:
  228.  
  229. };
  230.  
  231. /// Main Screen State
  232. class ExistenceClientStateGameMode: public ExistenceClientStateSingleton
  233. {
  234.     OBJECT(ExistenceClientStateGameMode);
  235. public:
  236.     ExistenceClientStateGameMode(Context * context);
  237.     virtual ~ExistenceClientStateGameMode();
  238.     virtual void Enter();
  239.     virtual void Exit();
  240.     virtual void OnUpdate(Urho3D::StringHash eventType, Urho3D::VariantMap& eventData );
  241. private:
  242.     void GameMode(void);
  243. protected:
  244.  
  245. };
  246.  
  247. /// Player Create Login State
  248. class ExistenceClientStatePlayer: public ExistenceClientStateSingleton
  249. {
  250.     OBJECT(ExistenceClientStatePlayer);
  251. public:
  252.     ExistenceClientStatePlayer(Context * context);
  253.     virtual ~ExistenceClientStatePlayer();
  254.     virtual void Enter();
  255.     virtual void Exit();
  256.     virtual void OnUpdate(Urho3D::StringHash eventType, Urho3D::VariantMap& eventData );
  257. private:
  258.     void Player(void);
  259.     void CreatePlayerScreenUI(void);
  260.     void HandlerCameraOrientation(StringHash eventType, VariantMap& eventData);
  261.     void CameraOrientationRotateMove (float degrees, int movement);
  262.     void HandleMouseReleased(StringHash eventType, VariantMap& eventData);
  263.     void CreatePlayerUIHandleClosePressed(StringHash eventType, VariantMap& eventData);
  264.     void loadSceneCreationCreation(const char * lineinput);
  265.     void CreatePlayerUIHandleControlClicked(StringHash eventType, VariantMap& eventData);
  266.     void HandlePersonalitySelectionItemClick(StringHash eventType, VariantMap& eventData);
  267. protected:
  268.  
  269. };
  270.  
  271. /// Main Screen State
  272. class ExistenceClientStateProgress :public ExistenceClientStateSingleton
  273. {
  274.     OBJECT(ExistenceClientStateProgress);
  275. public:
  276.     ExistenceClientStateProgress(Context * context);
  277.     virtual ~ExistenceClientStateProgress();
  278.     virtual void Enter();
  279.     virtual void Exit();
  280.     virtual void OnUpdate(Urho3D::StringHash eventType, Urho3D::VariantMap& eventData );
  281. private:
  282.     void Progress(void);
  283.     void ProgressScreenUI(void);
  284.     void ProgressScreenUIHandleClosePressed(StringHash eventType, VariantMap& eventData);
  285.     void CreateCharacter(void);
  286.     void GenerateScene(terrain_rule terrainrule,const char *differentialfilename);
  287.     int GenerateSceneBuildWorld(terrain_rule terrainrule);
  288.     void loadDummyScene(void);
  289.     void loadScene(const int mode, const char * lineinput);
  290. protected:
  291.  
  292. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement