mirror of
https://github.com/Ragora/T2-CPP.git
synced 2026-03-07 22:40:27 +00:00
Begin transition to the new ModLoader paradigm. Begin cleaning up code.
This commit is contained in:
parent
015a9f4dc8
commit
cb9895a38e
39 changed files with 1429 additions and 967 deletions
24
CommonAPI/Common/include/DXAPI/AIConnection.h
Normal file
24
CommonAPI/Common/include/DXAPI/AIConnection.h
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#pragma once
|
||||
|
||||
#include <DXAPI/Move.h>
|
||||
#include <DXAPI/GameConnection.h>
|
||||
|
||||
namespace DX
|
||||
{
|
||||
class AIConnection : public GameConnection
|
||||
{
|
||||
public:
|
||||
AIConnection(unsigned int obj);
|
||||
|
||||
//! Whether or not this bot should use custom moves.
|
||||
bool mUseCustomMoves;
|
||||
|
||||
//! The custom move for this bot.
|
||||
Move mCustomMove;
|
||||
|
||||
/**
|
||||
* @brief Computes the current move for this bot.
|
||||
*/
|
||||
void generateMove(void);
|
||||
};
|
||||
} // End NameSpace DX
|
||||
|
|
@ -38,13 +38,25 @@ namespace DX
|
|||
typedef void* UnresolvedObject;
|
||||
|
||||
const char *GetModPaths(void);
|
||||
|
||||
bool IsFile(const char *filename);
|
||||
const char * StringTableInsert(const char * str,bool casesensitive) ;
|
||||
|
||||
const char * StringTableInsert(const char * str,bool casesensitive);
|
||||
|
||||
bool GetRelativePath(const char *filename, char *ret, int buffer_length);
|
||||
|
||||
bool GetRunningMod(char *ret, int buffer_length);
|
||||
|
||||
bool memPatch(unsigned int addr, unsigned char * data, unsigned int size);
|
||||
|
||||
bool memToHex(unsigned int addr, char * dst, int size, bool spaces);
|
||||
|
||||
unsigned int memToUInt(unsigned int addr);
|
||||
|
||||
float memToFloat(unsigned int addr);
|
||||
|
||||
bool SanitizeFileName(char *ret, int buffer_length);
|
||||
|
||||
//! Initializes all hooks for the engine.
|
||||
void initializeHooks(void);
|
||||
} // End NameSpace DX
|
||||
|
|
@ -7,12 +7,18 @@
|
|||
|
||||
namespace DX
|
||||
{
|
||||
/**
|
||||
* @brief A class representing an incoming connection to the Tribes 2 server.
|
||||
*/
|
||||
class GameConnection : public NetConnection
|
||||
{
|
||||
public:
|
||||
GameConnection(unsigned int obj);
|
||||
public:
|
||||
GameConnection(unsigned int obj);
|
||||
|
||||
ShapeBase getControlObject(void);
|
||||
|
||||
/**
|
||||
* @brief Gets the control object this game connection is controlling.
|
||||
* @return The shapebase instance being controlled.
|
||||
*/
|
||||
ShapeBase getControlObject(void);
|
||||
};
|
||||
} // End NameSpace DX
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@
|
|||
#include <LinkerAPI.h>
|
||||
namespace DX
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief Move structure.
|
||||
*/
|
||||
struct Move {
|
||||
int px;
|
||||
int py;
|
||||
|
|
@ -26,13 +28,14 @@ namespace DX
|
|||
bool triggers[6];
|
||||
|
||||
};
|
||||
|
||||
struct AIMove {
|
||||
unsigned int id;
|
||||
Move move;
|
||||
bool used;
|
||||
};
|
||||
|
||||
float clampFloat(float in);
|
||||
float clampMove(float in);
|
||||
void generateNullMove(Move * ret);
|
||||
|
||||
};
|
||||
|
|
@ -15,5 +15,7 @@ namespace DX
|
|||
const unsigned int &identifier;
|
||||
const unsigned int base_pointer_value;
|
||||
const unsigned int &dataBlock;
|
||||
|
||||
char& mName;
|
||||
};
|
||||
} // End NameSpace DX
|
||||
Loading…
Add table
Add a link
Reference in a new issue