129 lines
2.1 KiB
C
129 lines
2.1 KiB
C
#ifndef PIXELDEFENSE_SYSTEMS_H
|
|
#define PIXELDEFENSE_SYSTEMS_H
|
|
|
|
#include <flecs.h>
|
|
|
|
#include "components.h"
|
|
|
|
|
|
/**********************************
|
|
* Entity Systems
|
|
**********************************/
|
|
|
|
/* Observer (for unregistering collision)
|
|
* 0: Game (singleton)
|
|
* 1: Position
|
|
* 3: SpatialGridID
|
|
*/
|
|
void entitySpatialRemove(ecs_iter_t *it);
|
|
|
|
/* Observer (for releasing path objects)
|
|
* 0: Game (singleton) for object pool
|
|
* 1: Path
|
|
*/
|
|
void entityPathRemove(ecs_iter_t *it);
|
|
|
|
/* Observer (for updating animation state)
|
|
* 1: Animation
|
|
* 2: AnimationType
|
|
*/
|
|
void entitySetAnimationState(ecs_iter_t *it);
|
|
|
|
|
|
/*
|
|
* 0: Game (singleton) for entity map
|
|
* 1: Position
|
|
* 2: Size
|
|
* 3: Velocity (only entities with velocity change position)
|
|
* 4: SpatialGridID
|
|
*/
|
|
void entityUpdateSpatialID(ecs_iter_t *it);
|
|
|
|
/*
|
|
* 0: Game (singleton) for collisions
|
|
* 1: Position
|
|
* 2: Rotation
|
|
* 3: Velocity
|
|
* 4: AngularVelocity
|
|
* 5: SteeringOutput
|
|
*/
|
|
void entityUpdateKinematic(ecs_iter_t *it);
|
|
|
|
/*
|
|
* 1: Position
|
|
* 2: Rotation
|
|
* 3: Velocity
|
|
* 4: TargetPosition
|
|
* 5: SteeringOutput
|
|
*/
|
|
void entityMoveToTarget(ecs_iter_t *it);
|
|
|
|
/*
|
|
* 0: Game (singleton) for object pool
|
|
* 1: Path
|
|
*/
|
|
void entityFollowPath(ecs_iter_t *it);
|
|
|
|
/*
|
|
* 1: Velocity
|
|
* 2: AnimationType
|
|
*/
|
|
void entityUpdateAnimationState(ecs_iter_t *it);
|
|
/*
|
|
* 0:
|
|
* 1: Animation
|
|
* 2: TextureRegion
|
|
*/
|
|
void entityUpdateAnimation(ecs_iter_t *it);
|
|
|
|
|
|
/*
|
|
* 0:
|
|
*/
|
|
void renderTerrain(ecs_iter_t *it);
|
|
void renderBuildings(ecs_iter_t *it);
|
|
void renderEntities(ecs_iter_t *it);
|
|
|
|
/*
|
|
* 1: Position
|
|
* 2: Size
|
|
*/
|
|
void renderColliders(ecs_iter_t *it);
|
|
|
|
/*
|
|
* 1: Position
|
|
* 2: Rotation
|
|
*/
|
|
void renderRotationDirection(ecs_iter_t *it);
|
|
|
|
/*
|
|
* 1: Path
|
|
*/
|
|
void renderDebugPath(ecs_iter_t *it);
|
|
|
|
|
|
|
|
/**********************************
|
|
* Input systems
|
|
**********************************/
|
|
|
|
/*
|
|
* Task:
|
|
* 0: Game (singleton)
|
|
* 0: InputState (singleton)
|
|
*/
|
|
void updatePlayerInput();
|
|
|
|
/*
|
|
* Task:
|
|
* 0: Game (singleton)
|
|
* 0: InputState (singleton)
|
|
*/
|
|
void drawPlayerInputUI();
|
|
|
|
/**********************************
|
|
* UI systems
|
|
**********************************/
|
|
|
|
#endif //PIXELDEFENSE_SYSTEMS_H
|