refactor: Refactorized whole project structure
This commit is contained in:
17
source/classes/CMakeLists.txt
Normal file
17
source/classes/CMakeLists.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
target_sources(${PYG2O_MODULE_NAME}
|
||||
PRIVATE
|
||||
squirrel/Daedalus.cpp
|
||||
squirrel/DamageDescription.cpp
|
||||
squirrel/ItemGround.cpp
|
||||
squirrel/ItemsGround.cpp
|
||||
squirrel/Mds.cpp
|
||||
squirrel/Packet.cpp
|
||||
squirrel/Sky.cpp
|
||||
squirrel/Way.cpp
|
||||
)
|
||||
|
||||
target_include_directories(${PYG2O_MODULE_NAME}
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/
|
||||
)
|
||||
19
source/classes/python/Daedalus.h
Normal file
19
source/classes/python/Daedalus.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef _PYDAEDALUS_H_
|
||||
#define _PYDAEDALUS_H_
|
||||
|
||||
#include <pybind11/embed.h>
|
||||
#include "squirrel/Daedalus.h"
|
||||
|
||||
namespace py = pybind11;
|
||||
|
||||
class PyDaedalus
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
static nonut::Int index(nonut::String value) { return nonut::Daedalus::get()->index(value); }
|
||||
static py::dict symbol(nonut::String value) { return nonut::Daedalus::get()->symbol(value).data; }
|
||||
static py::dict instance(nonut::String value) { return nonut::Daedalus::get()->instance(value).data; }
|
||||
};
|
||||
|
||||
#endif
|
||||
32
source/classes/python/DamageDescription.h
Normal file
32
source/classes/python/DamageDescription.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef _PYDAMAGEDESCRIPTION_H
|
||||
#define _PYDAMAGEDESCRIPTION_H
|
||||
|
||||
#include "squirrel/DamageDescription.h"
|
||||
|
||||
class PyDamageDescription
|
||||
{
|
||||
private:
|
||||
nonut::DamageDescription *sqobj;
|
||||
|
||||
public:
|
||||
PyDamageDescription(SQObject obj) { if (obj._type == OT_NULL) throw py::type_error("Presented Squirrel Object doesn't exist (type: null)"); sqobj = new nonut::DamageDescription(obj); }
|
||||
|
||||
nonut::Int getFlags() { return sqobj->flags; }
|
||||
nonut::Int getDamage() { return sqobj->damage; }
|
||||
nonut::String getItemInstance() { return sqobj->item_instance; }
|
||||
nonut::Int getDistance() { return sqobj->distance; }
|
||||
nonut::Int getSpellId() { return sqobj->spell_id; }
|
||||
nonut::Int getSpellLevel() { return sqobj->spell_level; }
|
||||
nonut::String getNode() { return sqobj->node; }
|
||||
|
||||
void setFlags(nonut::Int value) { sqobj->flags = value; }
|
||||
void setDamage(nonut::Int value) { sqobj->damage = value; }
|
||||
void setDistance(nonut::Int value) { sqobj->distance = value; }
|
||||
void setSpellId(nonut::Int value) { sqobj->spell_id = value; }
|
||||
void setSpellLevel(nonut::Int value) { sqobj->spell_level = value; }
|
||||
void setNode(nonut::String value) { sqobj->node = value; }
|
||||
|
||||
void del() { delete sqobj; }
|
||||
};
|
||||
|
||||
#endif
|
||||
32
source/classes/python/ItemGround.h
Normal file
32
source/classes/python/ItemGround.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef _PY_ITEMGROUND_H_
|
||||
#define _PY_ITEMGROUND_H_
|
||||
|
||||
#include <pybind11/embed.h>
|
||||
#include "squirrel/ItemGround.h"
|
||||
|
||||
namespace py = pybind11;
|
||||
|
||||
class PyItemGround
|
||||
{
|
||||
private:
|
||||
nonut::ItemGround *sqobj;
|
||||
|
||||
public:
|
||||
PyItemGround(SQObject obj) { if (obj._type == OT_NULL) throw py::type_error("Presented Squirrel Object doesn't exist (type: null)"); sqobj = new nonut::ItemGround(obj); }
|
||||
PyItemGround(nonut::ItemGround obj) { if (obj.isNull()) throw py::type_error("Presented ItemGround doesn't exist (type: null)"); sqobj = &obj; }
|
||||
|
||||
py::tuple getPosition() { return py::make_tuple(sqobj->getPosition().toTuple()); }
|
||||
py::tuple getRotation() { return py::make_tuple(sqobj->getRotation().toTuple()); }
|
||||
|
||||
nonut::Int getId() { return sqobj->id; }
|
||||
nonut::String getInstance() { return sqobj->instance; }
|
||||
nonut::Int getAmount() { return sqobj->amount; }
|
||||
nonut::String getWorld() { return sqobj->world; }
|
||||
nonut::Int getVirtualWorld() { return sqobj->virtualWorld; }
|
||||
|
||||
void setVirtualWorld(nonut::Int value) { sqobj->virtualWorld = value; }
|
||||
|
||||
void del() { delete sqobj; }
|
||||
};
|
||||
|
||||
#endif
|
||||
24
source/classes/python/ItemsGround.h
Normal file
24
source/classes/python/ItemsGround.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef _PYITEMSGROUND_H_
|
||||
#define _PYITEMSGROUND_H_
|
||||
|
||||
#include "squirrel/ItemsGround.h"
|
||||
#include "squirrel/ItemGround.h"
|
||||
#include "Dictionary.h"
|
||||
|
||||
class PyItemsGround
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
static PyItemGround getById(nonut::Int value) { return PyItemGround(nonut::ItemsGround::get()->getById(value)); }
|
||||
static nonut::Int create(py::dict value)
|
||||
{
|
||||
Sqrat::Table* pTable = PyDictionary::toSqObject(value);
|
||||
nonut::Int result = nonut::ItemsGround::get()->create(pTable->GetObject());
|
||||
delete pTable;
|
||||
return result;
|
||||
}
|
||||
static void destroy(nonut::Int value) { nonut::ItemsGround::get()->destroy(value); }
|
||||
};
|
||||
|
||||
#endif
|
||||
17
source/classes/python/Mds.h
Normal file
17
source/classes/python/Mds.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef _PYMDS_H
|
||||
#define _PYMDS_H
|
||||
|
||||
#include <pybind11/embed.h>
|
||||
#include "squirrel/Mds.h"
|
||||
namespace py = pybind11;
|
||||
|
||||
class PyMds
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
static int id(std::string mdsName) { return nonut::Mds::get()->id(mdsName); }
|
||||
static std::string name(int mdsId) { return nonut::Mds::get()->name(mdsId); }
|
||||
};
|
||||
|
||||
#endif
|
||||
47
source/classes/python/Packet.h
Normal file
47
source/classes/python/Packet.h
Normal file
@@ -0,0 +1,47 @@
|
||||
#ifndef _PYPACKET_H_
|
||||
#define _PYPACKET_H_
|
||||
|
||||
#include "squirrel/Packet.h"
|
||||
|
||||
class PyPacket
|
||||
{
|
||||
private:
|
||||
nonut::Packet *sqpacket;
|
||||
|
||||
public:
|
||||
PyPacket() { sqpacket = new nonut::Packet(); };
|
||||
PyPacket(SQObject obj) { if (obj._type == OT_NULL) throw py::type_error("Presented Squirrel Object doesn't exist (type: null)"); sqpacket = new nonut::Packet(obj); }
|
||||
|
||||
void reset() { sqpacket->reset(); }
|
||||
void send(nonut::Int id, nonut::Int value) { sqpacket->send(id, value); }
|
||||
void sendToAll(nonut::Int value) { sqpacket->sendToAll(value); };
|
||||
|
||||
void writeInt8(nonut::Int value) { sqpacket->writeInt8(value); }
|
||||
void writeUInt8(nonut::Int value) { sqpacket->writeUInt8(value); }
|
||||
void writeInt16(nonut::Int value) { sqpacket->writeInt16(value); }
|
||||
void writeUInt16(nonut::Int value) { sqpacket->writeUInt16(value); }
|
||||
void writeInt32(nonut::Int value) { sqpacket->writeInt32(value); }
|
||||
void writeUInt32(nonut::Int value) { sqpacket->writeUInt32(value); }
|
||||
|
||||
void writeBool(nonut::Bool value) { sqpacket->writeBool(value); }
|
||||
void writeFloat(nonut::Float value) { sqpacket->writeFloat(value); }
|
||||
void writeString(nonut::String value) { sqpacket->writeString(value); }
|
||||
|
||||
nonut::Int readInt8() { return sqpacket->readInt8(); }
|
||||
nonut::Int readUInt8() { return sqpacket->readUInt8(); }
|
||||
nonut::Int readInt16() { return sqpacket->readInt16(); }
|
||||
nonut::Int readUInt16() { return sqpacket->readUInt16(); }
|
||||
nonut::Int readInt32() { return sqpacket->readInt32(); }
|
||||
nonut::Int readUInt32() { return sqpacket->readUInt32(); }
|
||||
|
||||
nonut::Bool readBool() { return sqpacket->readBool(); }
|
||||
nonut::Float readFloat() { return sqpacket->readFloat(); }
|
||||
nonut::String readString() { return sqpacket->readString(); }
|
||||
|
||||
nonut::Int getBitsUsed() { return sqpacket->bitsUsed; }
|
||||
nonut::Int getBytesUsed() { return sqpacket->bytesUsed; }
|
||||
|
||||
void del() { delete sqpacket; }
|
||||
};
|
||||
|
||||
#endif
|
||||
31
source/classes/python/Sky.h
Normal file
31
source/classes/python/Sky.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef _PYSKY_H_
|
||||
#define _PYSKY_H_
|
||||
|
||||
#include <pybind11/embed.h>
|
||||
#include "squirrel/Sky.h"
|
||||
|
||||
namespace py = pybind11;
|
||||
|
||||
class PySky
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
static void setWeather(nonut::Int value) { nonut::Sky::get()->weather = value; }
|
||||
static nonut::Int getWeather() { return nonut::Sky::get()->weather; }
|
||||
static void setRaining(nonut::Bool value) { nonut::Sky::get()->raining = value; }
|
||||
static nonut::Bool getRaining() { return nonut::Sky::get()->raining; }
|
||||
static void setRenderLightning(nonut::Bool value) { nonut::Sky::get()->renderLightning = value; }
|
||||
static nonut::Bool getRenderLightning() { return nonut::Sky::get()->renderLightning; }
|
||||
static void setWindScale(nonut::Float value) { nonut::Sky::get()->windScale = value; }
|
||||
static nonut::Float getWindScale() { return nonut::Sky::get()->windScale; }
|
||||
static void setDontRain(nonut::Bool value) { nonut::Sky::get()->dontRain = value; }
|
||||
static nonut::Bool getDontRain() { return nonut::Sky::get()->dontRain; }
|
||||
|
||||
static void setRainStartTime(nonut::Int h, nonut::Int m) { nonut::Sky::get()->setRainStartTime(h, m); }
|
||||
static void setRainStopTime(nonut::Int h, nonut::Int m) { nonut::Sky::get()->setRainStopTime(h, m); }
|
||||
static py::dict getRainStartTime() { return nonut::Sky::get()->getRainStartTime().data; }
|
||||
static py::dict getRainStopTime() { return nonut::Sky::get()->getRainStopTime().data; }
|
||||
};
|
||||
|
||||
#endif
|
||||
24
source/classes/python/Way.h
Normal file
24
source/classes/python/Way.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef _PYWAY_H_
|
||||
#define _PYWAY_H_
|
||||
|
||||
#include "squirrel/Way.h"
|
||||
|
||||
class PyWay
|
||||
{
|
||||
private:
|
||||
nonut::Way *sqway;
|
||||
|
||||
public:
|
||||
PyWay(std::string world, std::string start, std::string end) { sqway = new nonut::Way(world, start, end); };
|
||||
PyWay(SQObject obj) { if (obj._type == OT_NULL) throw py::type_error("Presented Squirrel Object doesn't exist (type: null)"); sqway = new nonut::Way(obj); }
|
||||
|
||||
py::list getWaypoints() { return sqway->getWaypoints().data; }
|
||||
int getCountWaypoints() { return sqway->getCountWaypoints(); }
|
||||
|
||||
std::string getStart() { return sqway->start; }
|
||||
std::string getEnd() { return sqway->end; }
|
||||
|
||||
void del() { delete sqway; }
|
||||
};
|
||||
|
||||
#endif
|
||||
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