mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-17 01:32:21 +02:00
Empty function for hero movement
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#include "stdafx.h"
|
||||
#include "CCallback.h"
|
||||
#include "CPathfinder.h"
|
||||
|
||||
bool CCallback::moveHero(int ID, int3 destPoint)
|
||||
{
|
||||
|
@ -1,10 +1,17 @@
|
||||
#ifndef CCALLBACK_H
|
||||
#define CCALLBACK_H
|
||||
class CGameState;
|
||||
struct HeroMoveDetails
|
||||
{
|
||||
int3 src, dst; //source and destination points
|
||||
int heroID; //which hero
|
||||
int owner;
|
||||
};
|
||||
class CCallback
|
||||
{
|
||||
protected:
|
||||
CGameState * gs;
|
||||
|
||||
public:
|
||||
bool moveHero(int ID, int3 destPoint);
|
||||
};
|
||||
|
@ -172,9 +172,10 @@ void CPlayerInterface::yourTurn()
|
||||
SDL_Delay(5); //give time for other apps
|
||||
SDL_framerateDelay(mainLoopFramerateKeeper);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CPlayerInterface::heroMoved(const HeroMoveDetails & details)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ BOOST_TRIBOOL_THIRD_STATE(outOfRange)
|
||||
using namespace boost::logic;
|
||||
class CAdvMapInt;
|
||||
|
||||
struct HeroMoveDetails;
|
||||
class CIntObject //interface object
|
||||
{
|
||||
public:
|
||||
@ -78,6 +79,8 @@ public:
|
||||
int playerID, serialID;
|
||||
|
||||
virtual void yourTurn()=0{};
|
||||
|
||||
virtual void heroMoved(const HeroMoveDetails & details)=0;
|
||||
};
|
||||
class CGlobalAI : public CGameInterface // AI class (to derivate)
|
||||
{
|
||||
@ -98,6 +101,7 @@ public:
|
||||
std::vector<MotionInterested*> motioninterested;
|
||||
|
||||
void yourTurn();
|
||||
void heroMoved(const HeroMoveDetails & details);
|
||||
void handleEvent(SDL_Event * sEvent);
|
||||
void init();
|
||||
|
||||
|
11
CMT.cpp
11
CMT.cpp
@ -63,10 +63,8 @@ TTF_Font * TNRB16, *TNR, *GEOR13, *GEORXX, *GEORM;
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
|
||||
//CBIKHandler cb;
|
||||
//cb.open("CSECRET.BIK");
|
||||
|
||||
THC timeHandler tmh;
|
||||
THC tmh.getDif();
|
||||
int xx=0, yy=0, zz=0;
|
||||
@ -236,9 +234,12 @@ int _tmain(int argc, _TCHAR* argv[])
|
||||
|
||||
for (int i=0; i<cgi->scenarioOps.playerInfos.size();i++) //initializing interfaces
|
||||
{
|
||||
if(cgi->scenarioOps.playerInfos[i].name=="AI")
|
||||
cgi->playerint.push_back(new CGlobalAI());
|
||||
else
|
||||
|
||||
//TODO: uncomment when AI will be done
|
||||
|
||||
//if(cgi->scenarioOps.playerInfos[i].name=="AI")
|
||||
// cgi->playerint.push_back(new CGlobalAI());
|
||||
//else
|
||||
{
|
||||
cgi->playerint.push_back(new CPlayerInterface(cgi->scenarioOps.playerInfos[i].color,i));
|
||||
((CPlayerInterface*)(cgi->playerint[i]))->init();
|
||||
|
Reference in New Issue
Block a user