refactor: Refactorized whole project structure
This commit is contained in:
23
source/classes/squirrel/Daedalus.cpp
Normal file
23
source/classes/squirrel/Daedalus.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <CommonHeader.h>
|
||||
#include "Daedalus.h"
|
||||
|
||||
namespace nonut
|
||||
{
|
||||
Daedalus* Daedalus::get()
|
||||
{
|
||||
if (inst == nullptr)
|
||||
{
|
||||
inst = new Daedalus();
|
||||
}
|
||||
return inst;
|
||||
}
|
||||
|
||||
Daedalus::Daedalus() :
|
||||
StaticClass("Daedalus"),
|
||||
|
||||
METHOD_CTOR(index),
|
||||
METHOD_CTOR(symbol),
|
||||
METHOD_CTOR(instance)
|
||||
{
|
||||
}
|
||||
}
|
||||
27
source/classes/squirrel/Daedalus.h
Normal file
27
source/classes/squirrel/Daedalus.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef _DAEDALUS_H_
|
||||
#define _DAEDALUS_H_
|
||||
#include <string>
|
||||
|
||||
#include <StaticClass.h>
|
||||
#include <CustomTypes.h>
|
||||
|
||||
namespace nonut
|
||||
{
|
||||
class Daedalus : public StaticClass
|
||||
{
|
||||
public:
|
||||
static Daedalus* get();
|
||||
|
||||
Function<Int, String> index;
|
||||
Function<SqDict, String> symbol;
|
||||
Function<SqDict, String> instance;
|
||||
|
||||
private:
|
||||
|
||||
static inline Daedalus* inst = nullptr;
|
||||
|
||||
Daedalus();
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
18
source/classes/squirrel/DamageDescription.cpp
Normal file
18
source/classes/squirrel/DamageDescription.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#include "CommonHeader.h"
|
||||
#include "DamageDescription.h"
|
||||
|
||||
namespace nonut
|
||||
{
|
||||
DamageDescription::DamageDescription(SQObject object) :
|
||||
Class("DamageDescription", object),
|
||||
|
||||
PROPERTY_CTOR(flags),
|
||||
PROPERTY_CTOR(damage),
|
||||
PROPERTY_CTOR(item_instance),
|
||||
PROPERTY_CTOR(distance),
|
||||
PROPERTY_CTOR(spell_id),
|
||||
PROPERTY_CTOR(spell_level),
|
||||
PROPERTY_CTOR(node)
|
||||
{
|
||||
}
|
||||
}
|
||||
25
source/classes/squirrel/DamageDescription.h
Normal file
25
source/classes/squirrel/DamageDescription.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef _DAMAGEDESCRIPTION_H_
|
||||
#define _DAMAGEDESCRIPTION_H_
|
||||
#include <string>
|
||||
|
||||
#include <Class.h>
|
||||
#include <CustomTypes.h>
|
||||
|
||||
namespace nonut
|
||||
{
|
||||
class DamageDescription : public Class
|
||||
{
|
||||
public:
|
||||
DamageDescription(SQObject object);
|
||||
|
||||
Property<Int> flags;
|
||||
Property<Int> damage;
|
||||
Property<String> item_instance;
|
||||
Property<Int> distance;
|
||||
Property<Int> spell_id;
|
||||
Property<Int> spell_level;
|
||||
Property<String> node;
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
19
source/classes/squirrel/ItemGround.cpp
Normal file
19
source/classes/squirrel/ItemGround.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <CommonHeader.h>
|
||||
#include "ItemGround.h"
|
||||
|
||||
namespace nonut
|
||||
{
|
||||
ItemGround::ItemGround(SQObject object) :
|
||||
Class("ItemGround", object),
|
||||
|
||||
METHOD_CTOR(getPosition),
|
||||
METHOD_CTOR(getRotation),
|
||||
|
||||
PROPERTY_CTOR(id),
|
||||
PROPERTY_CTOR(instance),
|
||||
PROPERTY_CTOR(amount),
|
||||
PROPERTY_CTOR(world),
|
||||
PROPERTY_CTOR(virtualWorld)
|
||||
{
|
||||
}
|
||||
}
|
||||
27
source/classes/squirrel/ItemGround.h
Normal file
27
source/classes/squirrel/ItemGround.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef _ITEMGROUND_H
|
||||
#define _ITEMGROUND_H
|
||||
#include <string>
|
||||
|
||||
#include <Class.h>
|
||||
#include <CustomTypes.h>
|
||||
|
||||
namespace nonut
|
||||
{
|
||||
class ItemGround : public Class
|
||||
{
|
||||
public:
|
||||
ItemGround(SQObject object);
|
||||
|
||||
Function<nonut::Position3d> getPosition;
|
||||
Function<nonut::Position3d> getRotation;
|
||||
|
||||
// Properties
|
||||
Property<Int> id;
|
||||
Property<String> instance;
|
||||
Property<Int> amount;
|
||||
Property<String> world;
|
||||
Property<Int> virtualWorld;
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
23
source/classes/squirrel/ItemsGround.cpp
Normal file
23
source/classes/squirrel/ItemsGround.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <CommonHeader.h>
|
||||
#include "ItemsGround.h"
|
||||
|
||||
namespace nonut
|
||||
{
|
||||
ItemsGround* ItemsGround::get()
|
||||
{
|
||||
if (inst == nullptr)
|
||||
{
|
||||
inst = new ItemsGround();
|
||||
}
|
||||
return inst;
|
||||
}
|
||||
|
||||
ItemsGround::ItemsGround() :
|
||||
StaticClass("ItemsGround"),
|
||||
|
||||
METHOD_CTOR(getById),
|
||||
METHOD_CTOR(create),
|
||||
METHOD_CTOR(destroy)
|
||||
{
|
||||
}
|
||||
}
|
||||
30
source/classes/squirrel/ItemsGround.h
Normal file
30
source/classes/squirrel/ItemsGround.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef _ITEMSGROUND_H_
|
||||
#define _ITEMSGROUND_H_
|
||||
#include <string>
|
||||
|
||||
#include <StaticClass.h>
|
||||
#include <CustomTypes.h>
|
||||
#include "ItemGround.h"
|
||||
#include <pybind11/embed.h>
|
||||
namespace py = pybind11;
|
||||
|
||||
namespace nonut
|
||||
{
|
||||
class ItemsGround : public StaticClass
|
||||
{
|
||||
public:
|
||||
static ItemsGround* get();
|
||||
|
||||
Function<ItemGround, Int> getById;
|
||||
Function<Int, SQObject> create;
|
||||
Function<void, Int> destroy;
|
||||
|
||||
private:
|
||||
|
||||
static inline ItemsGround* inst = nullptr;
|
||||
|
||||
ItemsGround();
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
22
source/classes/squirrel/Mds.cpp
Normal file
22
source/classes/squirrel/Mds.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <CommonHeader.h>
|
||||
#include "Mds.h"
|
||||
|
||||
namespace nonut
|
||||
{
|
||||
Mds* Mds::get()
|
||||
{
|
||||
if (inst == nullptr)
|
||||
{
|
||||
inst = new Mds();
|
||||
}
|
||||
return inst;
|
||||
}
|
||||
|
||||
Mds::Mds() :
|
||||
StaticClass("Mds"),
|
||||
|
||||
METHOD_CTOR(id),
|
||||
METHOD_CTOR(name)
|
||||
{
|
||||
}
|
||||
}
|
||||
26
source/classes/squirrel/Mds.h
Normal file
26
source/classes/squirrel/Mds.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef _MDS_H
|
||||
#define _MDS_H
|
||||
#include <string>
|
||||
|
||||
#include <StaticClass.h>
|
||||
#include <CustomTypes.h>
|
||||
|
||||
namespace nonut
|
||||
{
|
||||
class Mds : public StaticClass
|
||||
{
|
||||
public:
|
||||
static Mds* get();
|
||||
|
||||
Function<Int, String> id;
|
||||
Function<String, Int> name;
|
||||
|
||||
private:
|
||||
|
||||
static inline Mds* inst = nullptr;
|
||||
|
||||
Mds();
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
64
source/classes/squirrel/Packet.cpp
Normal file
64
source/classes/squirrel/Packet.cpp
Normal file
@@ -0,0 +1,64 @@
|
||||
#include <CommonHeader.h>
|
||||
#include "Packet.h"
|
||||
|
||||
namespace nonut
|
||||
{
|
||||
Packet::Packet() :
|
||||
Class("Packet"),
|
||||
METHOD_CTOR(reset),
|
||||
METHOD_CTOR(send),
|
||||
METHOD_CTOR(sendToAll),
|
||||
METHOD_CTOR(writeBool),
|
||||
METHOD_CTOR(writeInt8),
|
||||
METHOD_CTOR(writeUInt8),
|
||||
METHOD_CTOR(writeInt16),
|
||||
METHOD_CTOR(writeUInt16),
|
||||
METHOD_CTOR(writeInt32),
|
||||
METHOD_CTOR(writeUInt32),
|
||||
METHOD_CTOR(writeFloat),
|
||||
METHOD_CTOR(writeString),
|
||||
METHOD_CTOR(readBool),
|
||||
METHOD_CTOR(readInt8),
|
||||
METHOD_CTOR(readUInt8),
|
||||
METHOD_CTOR(readInt16),
|
||||
METHOD_CTOR(readUInt16),
|
||||
METHOD_CTOR(readInt32),
|
||||
METHOD_CTOR(readUInt32),
|
||||
METHOD_CTOR(readFloat),
|
||||
METHOD_CTOR(readString),
|
||||
|
||||
PROPERTY_CTOR(bitsUsed),
|
||||
PROPERTY_CTOR(bytesUsed)
|
||||
{
|
||||
classCtor();
|
||||
}
|
||||
|
||||
Packet::Packet(SQObject object) :
|
||||
Class("Packet", object),
|
||||
METHOD_CTOR(reset),
|
||||
METHOD_CTOR(send),
|
||||
METHOD_CTOR(sendToAll),
|
||||
METHOD_CTOR(writeBool),
|
||||
METHOD_CTOR(writeInt8),
|
||||
METHOD_CTOR(writeUInt8),
|
||||
METHOD_CTOR(writeInt16),
|
||||
METHOD_CTOR(writeUInt16),
|
||||
METHOD_CTOR(writeInt32),
|
||||
METHOD_CTOR(writeUInt32),
|
||||
METHOD_CTOR(writeFloat),
|
||||
METHOD_CTOR(writeString),
|
||||
METHOD_CTOR(readBool),
|
||||
METHOD_CTOR(readInt8),
|
||||
METHOD_CTOR(readUInt8),
|
||||
METHOD_CTOR(readInt16),
|
||||
METHOD_CTOR(readUInt16),
|
||||
METHOD_CTOR(readInt32),
|
||||
METHOD_CTOR(readUInt32),
|
||||
METHOD_CTOR(readFloat),
|
||||
METHOD_CTOR(readString),
|
||||
|
||||
PROPERTY_CTOR(bitsUsed),
|
||||
PROPERTY_CTOR(bytesUsed)
|
||||
{
|
||||
}
|
||||
}
|
||||
43
source/classes/squirrel/Packet.h
Normal file
43
source/classes/squirrel/Packet.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#ifndef _PACKET_H_
|
||||
#define _PACKET_H_
|
||||
#include <string>
|
||||
|
||||
#include <Class.h>
|
||||
#include <CustomTypes.h>
|
||||
|
||||
namespace nonut
|
||||
{
|
||||
class Packet : public Class
|
||||
{
|
||||
public:
|
||||
Packet();
|
||||
explicit Packet(SQObject object);
|
||||
|
||||
Function<void> reset;
|
||||
Function<void, Int, Int> send;
|
||||
Function<void, Int> sendToAll;
|
||||
Function<void, Bool> writeBool;
|
||||
Function<void, Int> writeInt8;
|
||||
Function<void, Int> writeUInt8;
|
||||
Function<void, Int> writeInt16;
|
||||
Function<void, Int> writeUInt16;
|
||||
Function<void, Int> writeInt32;
|
||||
Function<void, Int> writeUInt32;
|
||||
Function<void, Float> writeFloat;
|
||||
Function<void, String&> writeString;
|
||||
Function<Bool> readBool;
|
||||
Function<Int> readInt8;
|
||||
Function<Int> readUInt8;
|
||||
Function<Int> readInt16;
|
||||
Function<Int> readUInt16;
|
||||
Function<Int> readInt32;
|
||||
Function<Int> readUInt32;
|
||||
Function<Float> readFloat;
|
||||
Function<String> readString;
|
||||
|
||||
Property<Int> bitsUsed;
|
||||
Property<Int> bytesUsed;
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
30
source/classes/squirrel/Sky.cpp
Normal file
30
source/classes/squirrel/Sky.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <CommonHeader.h>
|
||||
#include "Sky.h"
|
||||
|
||||
namespace nonut
|
||||
{
|
||||
Sky* Sky::get()
|
||||
{
|
||||
if (inst == nullptr)
|
||||
{
|
||||
inst = new Sky();
|
||||
}
|
||||
return inst;
|
||||
}
|
||||
|
||||
Sky::Sky() :
|
||||
StaticClass("Sky"),
|
||||
|
||||
PROPERTY_CTOR(weather),
|
||||
PROPERTY_CTOR(raining),
|
||||
PROPERTY_CTOR(renderLightning),
|
||||
PROPERTY_CTOR(windScale),
|
||||
PROPERTY_CTOR(dontRain),
|
||||
|
||||
METHOD_CTOR(getRainStartTime),
|
||||
METHOD_CTOR(getRainStopTime),
|
||||
METHOD_CTOR(setRainStartTime),
|
||||
METHOD_CTOR(setRainStopTime)
|
||||
{
|
||||
}
|
||||
}
|
||||
34
source/classes/squirrel/Sky.h
Normal file
34
source/classes/squirrel/Sky.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef _SKY_H_
|
||||
#define _SKY_H_
|
||||
#include <string>
|
||||
|
||||
#include <StaticClass.h>
|
||||
#include <CustomTypes.h>
|
||||
|
||||
namespace nonut
|
||||
{
|
||||
class Sky : public StaticClass
|
||||
{
|
||||
public:
|
||||
static Sky* get();
|
||||
|
||||
Function<void, Int, Int> setRainStartTime;
|
||||
Function<SqDict> getRainStartTime;
|
||||
Function<void, Int, Int> setRainStopTime;
|
||||
Function<SqDict> getRainStopTime;
|
||||
|
||||
Property<Int> weather;
|
||||
Property<Bool> raining;
|
||||
Property<Bool> renderLightning;
|
||||
Property<Float> windScale;
|
||||
Property<Bool> dontRain;
|
||||
|
||||
private:
|
||||
|
||||
static inline Sky* inst = nullptr;
|
||||
|
||||
Sky();
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
26
source/classes/squirrel/Way.cpp
Normal file
26
source/classes/squirrel/Way.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include <CommonHeader.h>
|
||||
#include "Way.h"
|
||||
|
||||
namespace nonut
|
||||
{
|
||||
Way::Way(String world, String startWp, String endWp) :
|
||||
Class("Way"),
|
||||
METHOD_CTOR(getWaypoints),
|
||||
METHOD_CTOR(getCountWaypoints),
|
||||
|
||||
PROPERTY_CTOR(start),
|
||||
PROPERTY_CTOR(end)
|
||||
{
|
||||
classCtor(world, startWp, endWp);
|
||||
}
|
||||
|
||||
Way::Way(SQObject object) :
|
||||
Class("Way", object),
|
||||
METHOD_CTOR(getWaypoints),
|
||||
METHOD_CTOR(getCountWaypoints),
|
||||
|
||||
PROPERTY_CTOR(start),
|
||||
PROPERTY_CTOR(end)
|
||||
{
|
||||
}
|
||||
}
|
||||
24
source/classes/squirrel/Way.h
Normal file
24
source/classes/squirrel/Way.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef _WAY_H
|
||||
#define _WAY_H
|
||||
#include <string>
|
||||
|
||||
#include <Class.h>
|
||||
#include <CustomTypes.h>
|
||||
|
||||
namespace nonut
|
||||
{
|
||||
class Way : public Class
|
||||
{
|
||||
public:
|
||||
Way(String, String, String);
|
||||
explicit Way(SQObject object);
|
||||
|
||||
Property<String> start;
|
||||
Property<String> end;
|
||||
|
||||
Function<SqList> getWaypoints;
|
||||
Function<Int> getCountWaypoints;
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user