You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
835 B
51 lines
835 B
1 year ago
|
#pragma once
|
||
|
|
||
|
#include "olcPixelGameEngine.h"
|
||
|
|
||
|
struct Marker{
|
||
|
size_t index;
|
||
|
size_t size;
|
||
|
};
|
||
|
|
||
|
enum MemoryType{
|
||
|
HEALTH,
|
||
|
RANGE,
|
||
|
ATKSPD,
|
||
|
MOVESPD,
|
||
|
PROCEDURE
|
||
|
};
|
||
|
|
||
|
struct Memory{
|
||
|
MemoryType type;
|
||
|
int size;
|
||
|
};
|
||
|
|
||
|
struct Unit{
|
||
|
public:
|
||
|
Unit(std::vector<Memory>memory,vf2d pos,Renderable&img,bool friendly=false);
|
||
|
int GetHealth();
|
||
|
int GetRange();
|
||
|
int GetAtkSpd();
|
||
|
int GetMoveSpd();
|
||
|
int GetProcedure();
|
||
|
int GetMemorySize();
|
||
|
std::vector<bool>memory;
|
||
|
virtual void Update(float fElapsedTime)=0;
|
||
|
virtual void Draw(PixelGameEngine*pge);
|
||
|
protected:
|
||
|
vf2d pos;
|
||
|
bool friendly;
|
||
|
Renderable&img;
|
||
|
Marker health;
|
||
|
Marker range;
|
||
|
Marker atkSpd;
|
||
|
Marker moveSpd;
|
||
|
Marker procedure;
|
||
|
private:
|
||
|
int GetBits(Marker&m);
|
||
|
};
|
||
|
|
||
|
struct BasicUnit:Unit{
|
||
|
BasicUnit(vf2d pos,Renderable&img,bool friendly=false);
|
||
|
void Update(float fElapsedTime)override;
|
||
|
};
|