HoverRace  2.0
AvatarSelectScene.h
Go to the documentation of this file.
1 
2 // AvatarSelectScene.h
3 //
4 // Copyright (c) 2016 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 #include "DialogScene.h"
25 
26 namespace HoverRace {
27  namespace Client {
28  class GameDirector;
29  }
30  namespace Display {
31  class Display;
32  class Picture;
33  }
34  namespace Player {
35  class AvatarGallery;
36  }
37 }
38 
39 namespace HoverRace {
40 namespace Client {
41 
47 {
48  using SUPER = DialogScene;
49 
50 public:
52  const std::string &parentTitle,
53  std::shared_ptr<Player::AvatarGallery> gallery,
54  const std::string &avatarName = {});
55  virtual ~AvatarSelectScene() { }
56 
57 public:
58  const std::string &GetAvatarName() const { return avatarName; }
59 
60 public:
61  void OnAvatarSelected(const std::string &name);
62 
63 public:
64  using confirmSignal_t = boost::signals2::signal<void(const std::string&)>;
65  confirmSignal_t &GetConfirmSignal() { return confirmSignal; }
66 
67 private:
68  std::shared_ptr<Player::AvatarGallery> gallery;
69  std::string avatarName;
70 
71  std::shared_ptr<Display::Picture> previewPic;
72 
73  std::list<boost::signals2::scoped_connection> conns;
74 
76 };
77 
78 } // namespace Client
79 } // namespace HoverRace
const std::string & GetAvatarName() const
Definition: AvatarSelectScene.h:58
Interface for game client shells.
Definition: GameDirector.h:57
confirmSignal_t confirmSignal
Definition: AvatarSelectScene.h:75
boost::signals2::signal< void(const std::string &)> confirmSignal_t
Definition: AvatarSelectScene.h:64
confirmSignal_t & GetConfirmSignal()
Definition: AvatarSelectScene.h:65
GameDirector & director
Definition: TestLabScene.cpp:160
Select an avatar from the avatar gallery.
Definition: AvatarSelectScene.h:46
std::shared_ptr< Player::AvatarGallery > gallery
Definition: AvatarSelectScene.h:68
std::shared_ptr< Display::Picture > previewPic
Definition: AvatarSelectScene.h:71
std::list< boost::signals2::scoped_connection > conns
Definition: AvatarSelectScene.h:73
Base class for scenes with a title and status area.
Definition: DialogScene.h:46
Base class for display managers.
Definition: Display.h:73
std::string avatarName
Definition: AvatarSelectScene.h:69
virtual ~AvatarSelectScene()
Definition: AvatarSelectScene.h:55
Definition: Announcement.h:24