2008-12-26 03:15:47 +02:00
# ifndef __CGENIUSAI_H__
# define __CGENIUSAI_H__
2009-05-10 11:15:30 +03:00
# include "Common.h"
# include "BattleLogic.h"
# include "GeneralAI.h"
2009-02-07 20:52:55 +02:00
2008-12-26 03:15:47 +02:00
namespace GeniusAI {
class CGeniusAI : public CGlobalAI
{
private :
2009-05-10 11:15:30 +03:00
ICallback * m_cb ;
GeniusAI : : BattleAI : : CBattleLogic * m_battleLogic ;
GeniusAI : : GeneralAI : : CGeneralAI m_generalAI ;
2008-12-26 03:15:47 +02:00
public :
2009-05-10 11:15:30 +03:00
CGeniusAI ( ) ;
virtual ~ CGeniusAI ( ) ;
2008-12-26 03:15:47 +02:00
virtual void init ( ICallback * CB ) ;
virtual void yourTurn ( ) ;
virtual void heroKilled ( const CGHeroInstance * ) ;
virtual void heroCreated ( const CGHeroInstance * ) ;
virtual void heroMoved ( const HeroMoveDetails & ) ;
virtual void heroPrimarySkillChanged ( const CGHeroInstance * hero , int which , int val ) { } ;
virtual void showSelDialog ( std : : string text , std : : vector < CSelectableComponent * > & components , int askID ) { } ;
2009-05-10 11:15:30 +03:00
virtual void showBlockingDialog ( const std : : string & text , const std : : vector < Component > & components , ui32 askID , const int soundID , bool selection , bool cancel ) ; //Show a dialog, player must take decision. If selection then he has to choose between one of given components, if cancel he is allowed to not choose. After making choice, CCallback::selectionMade should be called with number of selected component (1 - n) or 0 for cancel (if allowed) and askID.
2008-12-26 03:15:47 +02:00
virtual void tileRevealed ( int3 pos ) { } ;
virtual void tileHidden ( int3 pos ) { } ;
virtual void heroGotLevel ( const CGHeroInstance * hero , int pskill , std : : vector < ui16 > & skills , boost : : function < void ( ui32 ) > & callback ) ;
2009-04-12 03:58:41 +03:00
virtual void showGarrisonDialog ( const CArmedInstance * up , const CGHeroInstance * down , boost : : function < void ( ) > & onEnd ) ;
2008-12-26 03:15:47 +02:00
// battle
virtual void actionFinished ( const BattleAction * action ) ; //occurs AFTER every action taken by any stack or by the hero
virtual void actionStarted ( const BattleAction * action ) ; //occurs BEFORE every action taken by any stack or by the hero
virtual void battleAttack ( BattleAttack * ba ) ; //called when stack is performing attack
2009-03-21 14:49:58 +02:00
virtual void battleStacksAttacked ( std : : set < BattleStackAttacked > & bsa ) ; //called when stack receives damage (after battleAttack())
2008-12-26 03:15:47 +02:00
virtual void battleEnd ( BattleResult * br ) ;
virtual void battleNewRound ( int round ) ; //called at the beggining of each turn, round=-1 is the tactic phase, round=0 is the first "normal" turn
2009-03-31 23:47:53 +03:00
virtual void battleStackMoved ( int ID , int dest , int distance , bool end ) ;
2009-05-12 06:35:51 +03:00
virtual void battleSpellCast ( SpellCast * sc ) ;
2008-12-26 03:15:47 +02:00
virtual void battleStart ( CCreatureSet * army1 , CCreatureSet * army2 , int3 tile , CGHeroInstance * hero1 , CGHeroInstance * hero2 , bool side ) ; //called by engine when battle starts; side=0 - left, side=1 - right
virtual void battlefieldPrepared ( int battlefieldType , std : : vector < CObstacle * > obstacles ) ; //called when battlefield is prepared, prior the battle beginning
//
virtual void battleStackMoved ( int ID , int dest , bool startMoving , bool endMoving ) ;
virtual void battleStackAttacking ( int ID , int dest ) ;
virtual void battleStackIsAttacked ( int ID , int dmg , int killed , int IDby , bool byShooting ) ;
virtual BattleAction activeStack ( int stackID ) ;
} ;
}
2009-05-12 06:35:51 +03:00
# endif // __CGENIUSAI_H__