This commit is contained in:
aozhiwei 2020-07-12 15:46:37 +08:00
parent fc59843f1e
commit a8546f07ff
6 changed files with 26 additions and 4 deletions

View File

@ -11,3 +11,13 @@ void AIComponent::Update(int delta_time)
{
}
void AIComponent::SetAiLevel(int ai_level)
{
}
int AIComponent::GetAiLevel()
{
return ai_level_;
}

View File

@ -8,4 +8,10 @@ class AIComponent
virtual ~AIComponent();
virtual void Update(int delta_time);
void SetAiLevel(int ai_level);
int GetAiLevel();
private:
int ai_level_ = 0;
};

View File

@ -3,6 +3,7 @@
#include "android.h"
#include "metamgr.h"
#include "android.ai.h"
#include "android_new.ai.h"
#include "room.h"
#include "app.h"
@ -67,3 +68,10 @@ void Android::GiveEquip()
curr_weapon = &weapons[GUN_SLOT1];
}
}
void Android::SetAiLevel(int ai_level)
{
if (ai) {
ai->SetAiLevel(ai_level);
}
}

View File

@ -18,6 +18,7 @@ class Android : public Human
virtual void Initialize() override;
virtual void Update(int delta_time) override;
void GiveEquip();
void SetAiLevel(int ai_level);
protected:
Android();

View File

@ -38,7 +38,7 @@ void AndroidNewAI::Update(int delta_time)
if (hum->dead) {
return;
}
switch (ai_level_) {
switch (GetAiLevel()) {
case 1:
UpdateAiLevel1();
break;

View File

@ -21,7 +21,4 @@ private:
void UpdateAiLevel7();
void UpdateAiLevel8();
private:
int ai_level_ = 0;
};