HoverRace  2.0
TestElement.h
Go to the documentation of this file.
1 
2 // TestElement.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 "../ObjFac1/ObjFac1Res.h"
26 #include "../ObjFacTools/FreeElementBase.h"
27 #include "../Model/PhysicalCollision.h"
28 
29 namespace HoverRace {
30 namespace ObjFac1 {
31 
36 {
38 
40  {
43 
44  MR_Int32 ZMin() const override { return mPosition.mZ; }
45  MR_Int32 ZMax() const override { return mPosition.mZ + 1800; }
46  MR_Int32 AxisX() const override { return mPosition.mX; }
47  MR_Int32 AxisY() const override { return mPosition.mY; }
48  MR_Int32 RayLen() const override { return mRay; }
49  };
50 
51 public:
52  TestElement(ObjFacTools::ResourceLib &resourceLib, int pActorRes);
54 
55  int Simulate(MR_SimulationTime pDuration, Model::Track &track,
56  int pRoom) override;
57 
58 protected:
59 
60  // ContactEffectShapeInterface
61  void ApplyEffect(const Model::ContactEffect *pEffect,
62  MR_SimulationTime pTime, MR_SimulationTime pDuration,
63  BOOL pValidDirection, MR_Angle pHorizontalDirection,
64  MR_Int32 pZMin, MR_Int32 pZMax, Model::Track &track) override;
65 
66  const Model::ContactEffectList *GetEffectList() override;
67 
68  const Model::ShapeInterface *GetObstacleShape() override;
71 
72 private:
74 
75  // Logic part (Always present.. who cares it is a test
76  int mXSpeed;
77  int mYSpeed;
78 
81 
84 };
85 
86 } // namespace ObjFac1
87 } // namespace HoverRace
std::vector< ContactEffect * > ContactEffectList
Definition: ContactEffect.h:56
Model::ContactEffectList mContactEffectList
Definition: TestElement.h:83
Definition: TestElement.h:39
const Model::ShapeInterface * GetGivingContactEffectShape() override
Get the shape that gives an effect when touching while moving.
Definition: TestElement.cpp:186
const Model::ShapeInterface * GetReceivingContactEffectShape() override
Get the shape that gives an effect when touched by a moving element.
Definition: TestElement.cpp:180
int Simulate(MR_SimulationTime pDuration, Model::Track &track, int pRoom) override
Advance the simulation.
Definition: TestElement.cpp:61
const Model::ContactEffectList * GetEffectList() override
Definition: TestElement.cpp:170
int mYSpeed
Definition: TestElement.h:77
MR_SimulationTime mElapsedFrameTime
Definition: TestElement.h:73
Definition: FreeElementBase.h:48
MR_Int32 mRay
Definition: TestElement.h:41
Used to test and build new FreeElements.
Definition: TestElement.h:35
MR_Int32 ZMax() const override
Definition: TestElement.h:45
Definition: Shapes.h:50
Definition: WorldCoordinates.h:75
Model::PhysicalCollision mContactEffect
Definition: TestElement.h:82
MR_Int16 MR_Angle
Definition: WorldCoordinates.h:96
MR_Int32 ZMin() const override
Definition: TestElement.h:44
MR_Int32 mZ
Definition: WorldCoordinates.h:86
MR_Int32 MR_SimulationTime
Definition: WorldCoordinates.h:106
const Model::ShapeInterface * GetObstacleShape() override
Get the shape that stops other elements&#39; movement.
Definition: TestElement.cpp:135
Base class for all contact effects.
Definition: ContactEffect.h:44
~TestElement()
Definition: TestElement.h:53
MR_Int32 mX
Definition: WorldCoordinates.h:65
Cylinder mCollisionShape
Definition: TestElement.h:79
A track level.
Definition: Track.h:57
Definition: Shapes.h:75
MR_Int32 mY
Definition: WorldCoordinates.h:66
int32_t MR_Int32
Definition: MR_Types.h:43
MR_Int32 AxisX() const override
Definition: TestElement.h:46
MR_Int32 RayLen() const override
Definition: TestElement.h:48
MR_Int32 AxisY() const override
Definition: TestElement.h:47
Base class for object created with a Dll Factory.
Definition: DllObjectFactory.h:86
int mXSpeed
Definition: TestElement.h:76
Definition: PhysicalCollision.h:58
Cylinder mContactShape
Definition: TestElement.h:80
TestElement(ObjFacTools::ResourceLib &resourceLib, int pActorRes)
Definition: TestElement.cpp:47
Definition: Announcement.h:24
Legacy resource manager for ObjFac1.dat resources.
Definition: ResourceLib.h:55
MR_3DCoordinate mPosition
Definition: TestElement.h:42
void ApplyEffect(const Model::ContactEffect *pEffect, MR_SimulationTime pTime, MR_SimulationTime pDuration, BOOL pValidDirection, MR_Angle pHorizontalDirection, MR_Int32 pZMin, MR_Int32 pZMax, Model::Track &track) override
Definition: TestElement.cpp:142