mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
Public release of the DLU server code!
Have fun!
This commit is contained in:
22
dGame/dEntity/EntityCallbackTimer.cpp
Normal file
22
dGame/dEntity/EntityCallbackTimer.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "EntityCallbackTimer.h"
|
||||
|
||||
EntityCallbackTimer::EntityCallbackTimer(float time, std::function<void()> callback) {
|
||||
m_Time = time;
|
||||
m_Callback = callback;
|
||||
}
|
||||
|
||||
EntityCallbackTimer::~EntityCallbackTimer() {
|
||||
|
||||
}
|
||||
|
||||
std::function<void()> EntityCallbackTimer::GetCallback() {
|
||||
return m_Callback;
|
||||
}
|
||||
|
||||
float EntityCallbackTimer::GetTime() {
|
||||
return m_Time;
|
||||
}
|
||||
|
||||
void EntityCallbackTimer::Update(float deltaTime) {
|
||||
m_Time -= deltaTime;
|
||||
}
|
19
dGame/dEntity/EntityCallbackTimer.h
Normal file
19
dGame/dEntity/EntityCallbackTimer.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <functional>
|
||||
|
||||
class EntityCallbackTimer {
|
||||
public:
|
||||
EntityCallbackTimer(float time, std::function<void()> callback);
|
||||
~EntityCallbackTimer();
|
||||
|
||||
std::function<void()> GetCallback();
|
||||
float GetTime();
|
||||
|
||||
void Update(float deltaTime);
|
||||
|
||||
private:
|
||||
std::function<void()> m_Callback;
|
||||
float m_Time;
|
||||
};
|
40
dGame/dEntity/EntityInfo.h
Normal file
40
dGame/dEntity/EntityInfo.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "dCommonVars.h"
|
||||
#include "NiPoint3.h"
|
||||
#include "NiQuaternion.h"
|
||||
#include "LDFFormat.h"
|
||||
|
||||
class Spawner;
|
||||
|
||||
struct EntityInfo {
|
||||
EntityInfo() {
|
||||
spawner = nullptr;
|
||||
spawnerID = 0;
|
||||
hasSpawnerNodeID = false;
|
||||
spawnerNodeID = 0;
|
||||
id = 0;
|
||||
lot = LOT_NULL;
|
||||
pos = {0,0,0};
|
||||
rot = {0,0,0,0};
|
||||
settings = {};
|
||||
networkSettings = {};
|
||||
scale = 1.0f;
|
||||
}
|
||||
|
||||
Spawner* spawner;
|
||||
LWOOBJID spawnerID;
|
||||
|
||||
bool hasSpawnerNodeID;
|
||||
uint32_t spawnerNodeID;
|
||||
|
||||
LWOOBJID id;
|
||||
LOT lot;
|
||||
NiPoint3 pos;
|
||||
NiQuaternion rot;
|
||||
std::vector<LDFBaseData*> settings;
|
||||
std::vector<LDFBaseData*> networkSettings;
|
||||
float scale;
|
||||
};
|
22
dGame/dEntity/EntityTimer.cpp
Normal file
22
dGame/dEntity/EntityTimer.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "EntityTimer.h"
|
||||
|
||||
EntityTimer::EntityTimer(std::string name, float time) {
|
||||
m_Name = name;
|
||||
m_Time = time;
|
||||
}
|
||||
|
||||
EntityTimer::~EntityTimer() {
|
||||
|
||||
}
|
||||
|
||||
std::string EntityTimer::GetName() {
|
||||
return m_Name;
|
||||
}
|
||||
|
||||
float EntityTimer::GetTime() {
|
||||
return m_Time;
|
||||
}
|
||||
|
||||
void EntityTimer::Update(float deltaTime) {
|
||||
m_Time -= deltaTime;
|
||||
}
|
18
dGame/dEntity/EntityTimer.h
Normal file
18
dGame/dEntity/EntityTimer.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
class EntityTimer {
|
||||
public:
|
||||
EntityTimer(std::string name, float time);
|
||||
~EntityTimer();
|
||||
|
||||
std::string GetName();
|
||||
float GetTime();
|
||||
|
||||
void Update(float deltaTime);
|
||||
|
||||
private:
|
||||
std::string m_Name;
|
||||
float m_Time;
|
||||
};
|
Reference in New Issue
Block a user