HoverRace  2.0
TrackBundle.h
Go to the documentation of this file.
1 
2 // TrackBundle.h
3 //
4 // Copyright (c) 2010, 2013-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 #include "../Display/Res.h"
25 
26 #include "Bundle.h"
27 
28 #if defined(_WIN32) && defined(HR_ENGINE_SHARED)
29 # ifdef MR_ENGINE
30 # define MR_DllDeclare __declspec( dllexport )
31 # else
32 # define MR_DllDeclare __declspec( dllimport )
33 # endif
34 #else
35 # define MR_DllDeclare
36 #endif
37 
38 namespace HoverRace {
39  namespace Model {
40  class Track;
41  class TrackEntry;
42  }
43 }
44 
46 {
49 };
50 
51 namespace HoverRace {
52 namespace Parcel {
53 
59 {
60  using SUPER = Bundle;
61 public:
62  TrackBundle(const Util::OS::path_t &dir,
63  std::shared_ptr<Bundle> subBundle = std::shared_ptr<Bundle>());
64  virtual ~TrackBundle() { }
65 
66  std::shared_ptr<RecordFile> OpenParcel(const std::string &name,
67  bool writing = false) const override;
68 
69  std::shared_ptr<Model::Track> OpenTrack(const std::string &name) const;
70  std::shared_ptr<Model::Track> OpenTrack(
71  const std::shared_ptr<const Model::TrackEntry> &entry) const;
72  std::shared_ptr<Display::Res<Display::Texture>> LoadMap(
73  std::shared_ptr<const Model::TrackEntry> entry) const;
74  std::shared_ptr<Model::TrackEntry> OpenTrackEntry(
75  const std::string &name) const;
76 
77  MR_TrackAvail CheckAvail(const std::string &name) const;
78 };
79 
80 } // namespace Parcel
81 } // namespace HoverRace
82 
83 #undef MR_DllDeclare
boost::filesystem::path path_t
Definition: OS.h:57
Definition: TrackBundle.h:47
A source of parcels.
Definition: Bundle.h:45
MR_TrackAvail
Definition: TrackBundle.h:45
#define MR_DllDeclare
Definition: TrackBundle.h:35
virtual ~TrackBundle()
Definition: TrackBundle.h:64
Definition: Announcement.h:24
Definition: TrackBundle.h:48
A source of track parcels.
Definition: TrackBundle.h:58