Files
Client-Side-Prediction-Test/src/cspt-state.h

36 lines
668 B
C
Raw Normal View History

#ifndef CSPT_STATE_H
#define CSPT_STATE_H
#include <time.h>
#include <stdbool.h>
2023-07-12 01:12:18 +01:00
#include <sys/time.h>
#include <netinet/in.h>
struct clientMovement
{
double xPosition, yPosition, xVelocity, yVelocity;
bool leftAcceleration, rightAcceleration, upAcceleration, downAcceleration, registered;
};
struct clientInput
{
2023-07-06 00:22:59 +01:00
int clientNumber;
bool left, right, up, down;
};
struct gameState
{
2023-07-12 01:12:18 +01:00
struct timeval timestamp;
struct clientMovement clients[16];
};
struct networkThreadArguments
{
int * clientSockets;
struct gameState * state;
};
2023-07-06 00:22:59 +01:00
void updateInput(struct gameState * state, struct clientInput * message);
void doGameTick(struct gameState * state);
#endif