#ifndef __WEAPON_CHOICE_AI_H__
#define __WEAPON_CHOICE_AI_H__

#include <assert.h>
#include "WeaponControlSystem.h"
#include "GameCharacter.h"

class Weapon;

/**
*	Ö÷ÒªÊÇ¿¼ÂÇµ½ºÎÊ±Ê¹ÓÃÊ²Ã´ÎäÆ÷¶ÔÓÚ²»Í¬µÄ½ÇÉ«ÊÇÓÐ²»Í¬µÄÂß¼­µÄ£¬ËùÒÔ½«
*   ÕâÒ»¿éÂß¼­¶ÀÁ¢³ÉÒ»¸ö¶ÔÏó£¬Õë¶ÔÃ¿Ò»ÖÖ½ÇÉ«ÊµÏÖÒ»¸ö×ÓÀàÀ´ÃèÊöÕû¸öÑ¡Ôñ
*   ÎäÆ÷µÄÂß¼­
*/
class WeaponChoiceAI
{
public:
    WeaponChoiceAI(GameCharacter* owner)
    {
        m_pOwner            =   owner;
    }

    virtual ~WeaponChoiceAI()
    {

    }

    /**
    *	Ã¿Ò»´Îµ÷ÓÃ£¬¶¼»á¸ù¾Ýµ±Ç°Çé¿öÑ¡ÔñÒ»¸öºÏÊÊµÄÎäÆ÷£¬¸Ãº¯ÊýÖ»»áÔÚÉÙÊýµÄµØ·½±»µ÷ÓÃ
    *   £¨1£©ÔÚÉè¶¨¹¥»÷Ä¿±êµÄÊ±ºò±»µ÷ÓÃ
    *   £¨2£©ÔÚÃ¿´Î·¢¶¯¹¥»÷Ö®ºó»á±»µ÷ÓÃ
    *   ÕâÊÇÓÃÔÚÃ¿´ÎÖ»ÔÚ
    */
    void update()
    {
        // ÕæÕý¿¼ÂÇÒ»ÏÂ¸ü»»ÎäÆ÷µÄÂß¼­
        choiceWeapon();
    }

    /**
    *	¶¨ÆÚµ÷ÓÃµÄ 
    */
    virtual void regularUpdate(float dm)
    {

    }

    /**
    *	ÒòÎªÊÇÓÃÊ²Ã´ÎäÆ÷ÓëÖ®Ç°µÄ¹¥»÷ÓÐ¹Ø£¬ËùÒÔÔÚÃ¿´Î¹¥»÷µÄÊ±ºòÐèÒª»Øµ÷¸Ãº¯Êý£¬ÓÐÐ©
    *   ½ÇÉ«¿ÉÒÔÔÚ×ÓÀàÖÐÈ¥¸²¸Ç¸Ã·½·¨
    */
    virtual void attack()
    {
        update();
    }

    /**
    *	µ±¸ü¸ÄÁËµ±Ç°¹¥»÷Ä¿±êµÄÊ±ºò±»µ÷ÓÃ£¬Õâ¸ö¿ÉÄÜ»áÓ°Ïì½ÇÉ«ÎäÆ÷Ñ¡ÔñµÄÂß¼­
    */
    virtual void changeTarget()
    {

    }

    /**
    *	¶ÔÓÚÆÕÍ¨µÄAI£¬Ä¬ÈÏÇé¿öÏÂËùÓÐµÄÃüÁî¶¼ÊÇÎÞÐ§µÄ
    */
    virtual bool userOrder(WeaponTypeEnum aType)
    {
        return false;
    }

protected:
    /**
    *	ÔÚ´Ë´¦·â×°ÕæÕýµÄÎäÆ÷Ñ¡ÔñÂß¼­ 
    */
    virtual void choiceWeapon() {}
    
    /**
    *	Ìá¹©µÄ¿ì½Ý·½·¨À´Ñ¡ÔñÎäÆ÷ 
    */
    void changeWeapon(WeaponTypeEnum aType)
    {
        m_pOwner->getWeaponControlSystem()->changeWeapon(aType);
    }

    GameCharacter*    m_pOwner;                // ¶ÔÓ¦µÄÎäÆ÷¿ØÖÆÏµÍ³
};

#endif