-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bar105 ground move perf improve (#1370)
--------- Co-authored-by: lostsquirrel <lostsquirrel43@gmail.com>
- Loading branch information
1 parent
4b0f131
commit ab62871
Showing
9 changed files
with
395 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ | ||
|
||
#ifndef MOVE_TYPE_EVENTS_H__ | ||
#define MOVE_TYPE_EVENTS_H__ | ||
|
||
#include "System/float3.h" | ||
|
||
class CUnit; | ||
class CFeature; | ||
class CGroundMoveType; | ||
|
||
namespace MoveTypes { | ||
|
||
struct FeatureCollisionEvent { | ||
CUnit* collider; | ||
CFeature* collidee; | ||
|
||
FeatureCollisionEvent(CUnit* _collider, CFeature* _collidee) | ||
: collider(_collider) | ||
, collidee(_collidee) | ||
{} | ||
}; | ||
|
||
struct FeatureCrushEvent { | ||
CUnit* collider; | ||
CFeature* collidee; | ||
float3 crushImpulse; | ||
|
||
FeatureCrushEvent(CUnit* _collider, CFeature* _collidee, float3 _crushImpulse) | ||
: collider(_collider) | ||
, collidee(_collidee) | ||
, crushImpulse(_crushImpulse) | ||
{} | ||
}; | ||
|
||
struct FeatureMoveEvent { | ||
CUnit* collider; | ||
CFeature* collidee; | ||
float3 moveImpulse; | ||
|
||
FeatureMoveEvent(CUnit* _collider, CFeature* _collidee, float3 _moveImpulse) | ||
: collider(_collider) | ||
, collidee(_collidee) | ||
, moveImpulse(_moveImpulse) | ||
{} | ||
}; | ||
|
||
struct UnitCollisionEvent { | ||
CUnit* collider; | ||
CUnit* collidee; | ||
|
||
UnitCollisionEvent(CUnit* _collider, CUnit* _collidee) | ||
: collider(_collider) | ||
, collidee(_collidee) | ||
{} | ||
}; | ||
|
||
struct UnitCrushEvent { | ||
CUnit* collider; | ||
CUnit* collidee; | ||
float3 crushImpulse; | ||
|
||
UnitCrushEvent(CUnit* _collider, CUnit* _collidee, float3 _crushImpulse) | ||
: collider(_collider) | ||
, collidee(_collidee) | ||
, crushImpulse(_crushImpulse) | ||
{} | ||
}; | ||
|
||
struct UnitMovedEvent { | ||
CUnit* unit = nullptr; | ||
bool moved = false; | ||
}; | ||
|
||
struct ChangeHeadingEvent { | ||
int unitId; | ||
short deltaHeading = 0; | ||
bool changed = false; | ||
|
||
ChangeHeadingEvent(int _unitId) | ||
: unitId(_unitId) | ||
{} | ||
}; | ||
|
||
struct ChangeMainHeadingEvent { | ||
int unitId; | ||
bool changed = false; | ||
|
||
ChangeMainHeadingEvent(int _unitId) | ||
: unitId(_unitId) | ||
{} | ||
}; | ||
|
||
} | ||
|
||
#endif |
Oops, something went wrong.