add aicomponent
This commit is contained in:
parent
e356fbc67e
commit
e33223ddd5
8
server/gameserver/aicomponent.cc
Normal file
8
server/gameserver/aicomponent.cc
Normal file
@ -0,0 +1,8 @@
|
||||
#include "precompile.h"
|
||||
|
||||
#include "aicomponent.h"
|
||||
|
||||
void AIComponent::Update(int delta_time)
|
||||
{
|
||||
|
||||
}
|
10
server/gameserver/aicomponent.h
Normal file
10
server/gameserver/aicomponent.h
Normal file
@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
class Entity;
|
||||
class AIComponent
|
||||
{
|
||||
public:
|
||||
Entity* owner = nullptr;
|
||||
|
||||
virtual void Update(int delta_time);
|
||||
};
|
8
server/gameserver/android.ai.cc
Normal file
8
server/gameserver/android.ai.cc
Normal file
@ -0,0 +1,8 @@
|
||||
#include "precompile.h"
|
||||
|
||||
#include "android.ai.h"
|
||||
|
||||
void AndroidAI::Update(int delta_time)
|
||||
{
|
||||
|
||||
}
|
10
server/gameserver/android.ai.h
Normal file
10
server/gameserver/android.ai.h
Normal file
@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "aicomponent.h"
|
||||
|
||||
class AndroidAI : public AIComponent
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void Update(int delta_time);
|
||||
};
|
@ -3,10 +3,19 @@
|
||||
#include "android.h"
|
||||
#include "metamgr.h"
|
||||
#include "movement.h"
|
||||
#include "android.ai.h"
|
||||
|
||||
Android::Android()
|
||||
Android::Android():Human()
|
||||
{
|
||||
entity_subtype = EST_Android;
|
||||
ai = new AndroidAI;
|
||||
ai->owner = this;
|
||||
}
|
||||
|
||||
Android::~Android()
|
||||
{
|
||||
delete ai;
|
||||
ai = nullptr;
|
||||
}
|
||||
|
||||
void Android::Initialize()
|
||||
@ -17,4 +26,5 @@ void Android::Initialize()
|
||||
void Android::Update(int delta_time)
|
||||
{
|
||||
movement_component->Update(delta_time);
|
||||
ai->Update(delta_time);
|
||||
}
|
||||
|
@ -2,11 +2,14 @@
|
||||
|
||||
#include "human.h"
|
||||
|
||||
class AndroidAI;
|
||||
class Android : public Human
|
||||
{
|
||||
public:
|
||||
AndroidAI* ai = nullptr;
|
||||
|
||||
Android();
|
||||
~Android();
|
||||
virtual void Initialize() override;
|
||||
virtual void Update(int delta_time) override;
|
||||
};
|
||||
|
@ -10,6 +10,7 @@ namespace MetaData
|
||||
class Human : public Entity
|
||||
{
|
||||
public:
|
||||
int team_id = 0;
|
||||
std::string team_uniid;
|
||||
MetaData::Player* meta = nullptr;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user