minerswife.h
来自「系列三 看过这些之后 会对编程的概念和理解更加深刻的 不多 一定要仔细看才」· C头文件 代码 · 共 56 行
H
56 行
#ifndef MINERSWIFE_H
#define MINERSWIFE_H
#include <string>
#include "State.h"
#include "BaseGameEntity.h"
#include "Locations.h"
#include "MinersWifeOwnedStates.h"
#include "misc/ConsoleUtils.h"
#include "Miner.h"
#include "StateMachine.h"
#include "misc/Utils.h"
class MinersWife : public BaseGameEntity
{
private:
//an instance of the state machine class
StateMachine<MinersWife>* m_pStateMachine;
location_type m_Location;
public:
MinersWife(int id):BaseGameEntity(id),
m_Location(shack)
{
m_pStateMachine = new StateMachine<MinersWife>(this);
m_pStateMachine->SetCurrentState(DoHouseWork::Instance());
m_pStateMachine->SetGlobalState(WifesGlobalState::Instance());
}
~MinersWife(){delete m_pStateMachine;}
void Update();
StateMachine<MinersWife>* GetFSM()const{return m_pStateMachine;}
//----------------------------------------------------accessors
location_type Location()const{return m_Location;}
void ChangeLocation(const location_type loc){m_Location=loc;}
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?