HoverRace  2.0
MetaSession.h
Go to the documentation of this file.
1 
2 // MetaSession.h
3 //
4 // Copyright (c) 2014, 2015 Michael Imamura.
5 //
6 // Licensed under GrokkSoft HoverRace SourceCode License v1.0(the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // A copy of the license should have been attached to the package from which
10 // you have taken this file. If you can not find the license you can not use
11 // this file.
12 //
13 //
14 // The author makes no representations about the suitability of
15 // this software for any purpose. It is provided "as is" "AS IS",
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17 // implied.
18 //
19 // See the License for the specific language governing permissions
20 // and limitations under the License.
21 
22 #pragma once
23 
24 namespace HoverRace {
25  namespace Client {
26  namespace HoverScript {
27  class SessionPeer;
28  }
29  }
30  namespace Script {
31  class Core;
32  }
33 }
34 
35 namespace HoverRace {
36 namespace Client {
37 namespace HoverScript {
38 
44 {
45 public:
46  MetaSession(std::shared_ptr<SessionPeer> session);
47  virtual ~MetaSession();
48 
49 public:
50  std::shared_ptr<SessionPeer> GetSession() const { return session; }
51 
52 public:
53  virtual void OnInit() { }
54 
55  // Phases
56  virtual void OnPregame() { }
57  virtual void OnPlaying() { }
58  virtual void OnPostgame() { }
59  virtual void OnDone() { }
60 
61 public:
62  static void Register(Script::Core &scripting);
63 
64 private:
65  std::shared_ptr<SessionPeer> session;
66 };
67 
68 } // namespace HoverScript
69 } // namespace Client
70 } // namespace HoverRace
virtual void OnPostgame()
Definition: MetaSession.h:58
virtual void OnDone()
Definition: MetaSession.h:59
virtual void OnPregame()
Definition: MetaSession.h:56
std::shared_ptr< SessionPeer > session
Definition: MetaSession.h:65
Native base class for scripted sessions.
Definition: MetaSession.h:43
std::shared_ptr< SessionPeer > GetSession() const
Definition: MetaSession.h:50
Definition: Announcement.h:24
virtual void OnPlaying()
Definition: MetaSession.h:57
virtual void OnInit()
Definition: MetaSession.h:53
A script environment.
Definition: Core.h:66