component namespace contains enums and structures that define various attributes and types of game objects. These components are essential for identifying and managing entities within the Entity-Component-System (ECS) architecture.
namespace component {
enum Object { Background, Player, Weapon, Ennemies, InDestroy };
enum Type { None, Basic, Milespates, Boss };
struct Animations {
ecs::Clock _clock;
int _width;
int _height;
int _x;
int _y;
int _rotation;
Object _object;
Type _type;
};
}; // namespace component
ObjectDescription:
This enum defines the different categories of game objects.
Values:
Background: Represents background entities in the game.Player: Represents player-controlled entities.Weapon: Represents weapon entities used by players or enemies.Ennemies: Represents enemy entities in the game.InDestroy: Represents entities that are in the process of being destroyed.TypeDescription:
This enum categorizes the types of entities, helping to identify their behavior or role in the game.
Values:
None: No specific type assigned.Basic: Represents basic entities, such as standard enemies.Milespates: Represents milestone-related entities.Boss: Represents boss entities with unique behaviors.AnimationsDescription:
The Animations struct contains properties related to the animation state of an object, allowing for visual representation and movement within the game.
Members:
ecs::Clock _clock:
Used to track time for animations, ensuring smooth transitions and updates.
int _width:
The width of the animation frame or object.
int _height:
The height of the animation frame or object.
int _x:
The x-coordinate position of the object on the screen.
int _y:
The y-coordinate position of the object on the screen.
int _rotation:
The rotation angle of the object, enabling dynamic movement.
Object _object:
Indicates the type of object (e.g., Player, Weapon), facilitating network synchronization and object management.
Type _type:
Specifies the type of entity (e.g., Basic, Boss), aiding in gameplay logic and behavior differentiation.
component namespace plays a critical role in identifying and managing entities in the networked environment of the game. The Object and Type enums help the server and client distinguish between different entities, ensuring that their behavior and attributes are handled appropriately.