Move some files. Make copies of precompiled headers.

This commit is contained in:
hispidence 2022-01-20 18:23:33 +00:00
parent a0d199ae2d
commit 121468d4fc
6 changed files with 25 additions and 0 deletions

21
Scripting/framework.h Normal file
View file

@ -0,0 +1,21 @@
#pragma once
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <memory>
#include <functional>
#include <vector>
#include <map>
#include <string>
#include <array>
#include <d3d11.h>
#include <optional>
#include <SimpleMath.h>
#include "Game/debug/debug.h"
#include <algorithm>
#include <set>
using namespace DirectX;
using namespace DirectX::SimpleMath;
#pragma warning(disable: 4996)

View file

@ -0,0 +1 @@
#include "frameworkandsol.h"

View file

@ -0,0 +1,3 @@
#pragma once
#include "framework.h"
#include <sol.hpp>

View file

@ -0,0 +1,24 @@
#pragma once
#include "framework.h"
namespace sol {
class state;
}
struct PHD_3DPOS;
class GameScriptPosition {
public:
int x;
int y;
int z;
GameScriptPosition(int x, int y, int z);
GameScriptPosition(PHD_3DPOS const& pos);
std::string ToString() const;
void StoreInPHDPos(PHD_3DPOS& pos) const;
static void Register(sol::state*);
};

View file

@ -0,0 +1,69 @@
#include "frameworkandsol.h"
#include "GameScriptPosition.h"
#include "Specific/phd_global.h"
/***
Represents a position in the game world.
@miscclass Position
@pragma nostrip
*/
void GameScriptPosition::Register(sol::state* state)
{
state->new_usertype<GameScriptPosition>("Position",
sol::constructors<GameScriptPosition(int, int, int)>(),
sol::meta_function::to_string, &GameScriptPosition::ToString,
/// (int) x coordinate
//@mem x
"x", &GameScriptPosition::x,
/// (int) y coordinate
//@mem y
"y", &GameScriptPosition::y,
/// (int) z coordinate
//@mem z
"z", &GameScriptPosition::z
);
}
/***
@int X x coordinate
@int Y y coordinate
@int Z z coordinate
@return A Position object.
@function Position.new
*/
GameScriptPosition::GameScriptPosition(int aX, int aY, int aZ)
{
x = aX;
y = aY;
z = aZ;
}
GameScriptPosition::GameScriptPosition(PHD_3DPOS const& pos)
{
x = pos.xPos;
y = pos.yPos;
z = pos.zPos;
}
void GameScriptPosition::StoreInPHDPos(PHD_3DPOS& pos) const
{
pos.xPos = x;
pos.yPos = y;
pos.zPos = z;
}
/***
@tparam Position position this position
@treturn string A string showing the x, y, and z values of the position
@function __tostring
*/
std::string GameScriptPosition::ToString() const
{
return "{" + std::to_string(x) + ", " + std::to_string(y) + ", " + std::to_string(z) + "}";
}