Files
Cyd 2b8ca921cb Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS
Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
2026-06-24 21:28:16 -05:00

58 lines
1.2 KiB
C++

#ifndef __AIFORMATIONHPP__
#define __AIFORMATIONHPP__
/*
struct PATHELEMENT
{
int x,y;
bool operator< (const PATHELEMENT& p1) const;
bool operator== (const PATHELEMENT& p1) const;
PATHELEMENT (int nx,int ny) { x = nx; y = ny; }
PATHELEMENT (void) { x = -1; y = -1; }
};
*/
#include "ai move.hpp"
#include <queue>
#include <stack>
struct FormationData
{
AIMove *member;
int dx,dy;
bool operator< (const FormationData& p1)
{
if (dx < p1.dx)
return true;
if (dy < p1.dy)
return true;
return false;
}
};
class AIFormation
{
private:
CPoint curdes;
bool newdes;
std::queue<FormationData> m_CurrentMembers;
std::stack<PATHELEMENT> m_CurPath;
CPoint m_Location;
bool CalcPath (int depth,bool followshort); // depth = -1 means search until solution
float GetOneCost (int sx,int sy,int dx,int dy); // only to adjecent squares
float PathCostGuess (int sx,int sy,int dx,int dy);
public:
AIFormation (void);
~AIFormation (void);
bool AddAI (AI *newai);
bool AddMove (AIMove *newmove);
bool Think (double value);
void SetDestination (int x,int y);
const CPoint& Location (void) { return m_Location; }
};
#endif