HoverRace  2.0
Missile.h
Go to the documentation of this file.
1 
2 // Missile.h
3 //
4 // Copyright (c) 1995-1998 - Richard Langlois and Grokksoft Inc.
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 
23 #pragma once
24 
25 #include "../ObjFacTools/FreeElementBase.h"
26 #include "../Model/RaceEffects.h"
27 #include "../Model/PhysicalCollision.h"
28 
29 namespace HoverRace {
30  namespace VideoServices {
31  class ShortSound;
32  class ContinuousSound;
33  }
34 }
35 
36 
37 namespace HoverRace {
38 namespace ObjFac1 {
39 
40 class Missile :
42  protected Model::CylinderShape
43 {
45 
46 public:
47  Missile();
48  ~Missile() { }
49 
50 protected:
51  // Shape interface
52  MR_Int32 ZMin() const override;
53  MR_Int32 ZMax() const override;
54  MR_Int32 AxisX() const override;
55  MR_Int32 AxisY() const override;
56  MR_Int32 RayLen() const override;
57 
58 protected:
59  // Init interface
60  void SetOwnerId(int pOwner) override;
61 
62  // ContactEffectShapeInterface
63  const Model::ContactEffectList *GetEffectList() override;
64  const Model::ShapeInterface *GetGivingContactEffectShape() override { return this; }
65  const Model::ShapeInterface *GetReceivingContactEffectShape() override { return this; }
66 
67  int Simulate(MR_SimulationTime pTimeSlice,
68  Model::Track &track, int pRoom) override;
69  int InternalSimulate(MR_SimulationTime pDuration,
70  Model::Track &track, int pRoom);
71 
72  void ApplyEffect(const Model::ContactEffect *pEffect,
73  MR_SimulationTime pTime, MR_SimulationTime pDuration,
74  BOOL pValidDirection, MR_Angle pHorizontalDirection,
75  MR_Int32 pZMin, MR_Int32 pZMax,
76  Model::Track &pLevel) override;
77 
78  // Network state
79  Model::ElementNetState GetNetState() const override;
80  void SetNetState(int pDataLen, const MR_UInt8 *pData) override;
81 
82  // Sounds
83  void PlayExternalSounds(int pDB, int pPan) override;
84 
85 private:
86  int mHoverId;
91 
92  double mXSpeed;
93  double mYSpeed;
94 
98 };
99 
100 } // namespace ObjFac1
101 } // namespace HoverRace
std::vector< ContactEffect * > ContactEffectList
Definition: ContactEffect.h:56
Model::PhysicalCollision mCollisionEffect
Definition: Missile.h:88
int mHoverId
Definition: Missile.h:86
VideoServices::ShortSound * mBounceSound
Definition: Missile.h:96
const Model::ShapeInterface * GetReceivingContactEffectShape() override
Get the shape that gives an effect when touched by a moving element.
Definition: Missile.h:65
Definition: FreeElementBase.h:48
Definition: Shapes.h:50
double mYSpeed
Definition: Missile.h:93
MR_Int16 MR_Angle
Definition: WorldCoordinates.h:96
~Missile()
Definition: Missile.h:48
const Model::ShapeInterface * GetGivingContactEffectShape() override
Get the shape that gives an effect when touching while moving.
Definition: Missile.h:64
Definition: SoundServer.cpp:148
MR_Int32 MR_SimulationTime
Definition: WorldCoordinates.h:106
Base class for all contact effects.
Definition: ContactEffect.h:44
A track level.
Definition: Track.h:57
Definition: Shapes.h:75
int32_t MR_Int32
Definition: MR_Types.h:43
Definition: SoundServer.cpp:135
Definition: Missile.h:40
Model::LostOfControl mLostOfControlEffect
Definition: Missile.h:89
Model::ContactEffectList mEffectList
Definition: Missile.h:90
Base class for object created with a Dll Factory.
Definition: DllObjectFactory.h:86
Definition: PhysicalCollision.h:58
Definition: Announcement.h:24
MR_SimulationTime mLived
Definition: Missile.h:87
VideoServices::ContinuousSound * mMotorSound
Definition: Missile.h:97
bool mBounceSoundEvent
Definition: Missile.h:95
double mXSpeed
Definition: Missile.h:92
uint8_t MR_UInt8
Definition: MR_Types.h:40
Definition: RaceEffects.h:50
Definition: MazeElement.h:56