Add DMv3 stubs, add reflection warning
This commit is contained in:
@@ -168,6 +168,252 @@
|
||||
RelativePath="System.XML.dll"/>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath=".\src\include\Application.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\AudioPlayer.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\ax.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\BrowserCallHandler.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\CameraController.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Enum.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\ErrorFunctions.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Faces.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Globals.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\IEBrowser.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\IEDispatcher.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Mouse.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\propertyGrid.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\PropertyWindow.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Renderer.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\resource.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\StringFunctions.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\TextureHandler.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\ToolEnum.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\versioning.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\VS2005CompatShim.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\win32Defines.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\WindowFunctions.h">
|
||||
</File>
|
||||
<Filter
|
||||
Name="RapidXML">
|
||||
<File
|
||||
RelativePath=".\src\include\rapidxml\rapidxml.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\rapidxml\rapidxml_iterators.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\rapidxml\rapidxml_print.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\rapidxml\rapidxml_utils.hpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Listener">
|
||||
<File
|
||||
RelativePath=".\src\include\Listener\ButtonListener.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Listener\CameraButtonListener.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Listener\DeleteListener.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Listener\GUDButtonListener.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Listener\MenuButtonListener.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Listener\ModeSelectionListener.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Listener\RotateButtonListener.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Listener\ToolbarListener.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModel\WorkspaceInstance.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Tool">
|
||||
<File
|
||||
RelativePath=".\src\include\Tool\ArrowTool.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Tool\DraggerTool.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Tool\SurfaceTool.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Tool\Tool.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="DataModelV2">
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\DataModelInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\GroupInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\Instance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\LevelInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\LightingInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\PartInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\PVInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\SelectionService.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\SoundInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\SoundService.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\ThumbnailGeneratorInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\WorkspaceInstance.h">
|
||||
</File>
|
||||
<Filter
|
||||
Name="Gui">
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\BaseButtonInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\BaseGuiInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\GuiRootInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\ImageButtonInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\TextButtonInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\ToggleImageButtonInstance.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="XplicitNgine">
|
||||
<File
|
||||
RelativePath=".\src\include\XplicitNgine\XplicitNgine.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Helpers">
|
||||
<File
|
||||
RelativePath=".\src\include\base64.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Reflection"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath=".\src\include\Reflection\Reflection.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Reflection\ReflectionDataTable.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Reflection\ReflectionProperty.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Reflection\ReflectionProperty_impl.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="DataModelV3"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV3\DataModelInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV3\GroupInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV3\Instance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV3\LevelInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV3\PartInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV3\PVInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV3\WorkspaceInstance.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
@@ -486,209 +732,36 @@
|
||||
RelativePath=".\src\source\base64.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath=".\src\include\Application.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\AudioPlayer.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\ax.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\BrowserCallHandler.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\CameraController.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Enum.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\ErrorFunctions.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Faces.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Globals.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\IEBrowser.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\IEDispatcher.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Mouse.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\propertyGrid.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\PropertyWindow.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Renderer.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\resource.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\StringFunctions.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\TextureHandler.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\ToolEnum.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\versioning.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\VS2005CompatShim.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\win32Defines.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\WindowFunctions.h">
|
||||
</File>
|
||||
<Filter
|
||||
Name="RapidXML">
|
||||
Name="Reflection"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath=".\src\include\rapidxml\rapidxml.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\rapidxml\rapidxml_iterators.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\rapidxml\rapidxml_print.hpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\rapidxml\rapidxml_utils.hpp">
|
||||
RelativePath=".\src\source\Reflection\ReflectionDataTable.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Listener">
|
||||
Name="DataModelV3"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath=".\src\include\Listener\ButtonListener.h">
|
||||
RelativePath=".\src\source\DataModelV3\DataModelInstance.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Listener\CameraButtonListener.h">
|
||||
RelativePath=".\src\source\DataModelV3\GroupInstance.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Listener\DeleteListener.h">
|
||||
RelativePath=".\src\source\DataModelV3\Instance.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Listener\GUDButtonListener.h">
|
||||
RelativePath=".\src\source\DataModelV3\LevelInstance.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Listener\MenuButtonListener.h">
|
||||
RelativePath=".\src\source\DataModelV3\PartInstance.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Listener\ModeSelectionListener.h">
|
||||
RelativePath=".\src\source\DataModelV3\PVInstance.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Listener\RotateButtonListener.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Listener\ToolbarListener.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModel\WorkspaceInstance.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Tool">
|
||||
<File
|
||||
RelativePath=".\src\include\Tool\ArrowTool.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Tool\DraggerTool.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Tool\SurfaceTool.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\Tool\Tool.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="DataModelV2">
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\DataModelInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\GroupInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\Instance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\LevelInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\LightingInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\PartInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\PVInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\SelectionService.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\SoundInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\SoundService.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\ThumbnailGeneratorInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\WorkspaceInstance.h">
|
||||
</File>
|
||||
<Filter
|
||||
Name="Gui">
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\BaseButtonInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\BaseGuiInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\GuiRootInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\ImageButtonInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\TextButtonInstance.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV2\ToggleImageButtonInstance.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="XplicitNgine">
|
||||
<File
|
||||
RelativePath=".\src\include\XplicitNgine\XplicitNgine.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Helpers">
|
||||
<File
|
||||
RelativePath=".\src\include\base64.h">
|
||||
RelativePath=".\src\source\DataModelV3\WorkspaceInstance.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
|
||||
BIN
Blocks3D.opt
BIN
Blocks3D.opt
Binary file not shown.
1331
Blocks3D.plg
1331
Blocks3D.plg
File diff suppressed because it is too large
Load Diff
@@ -698,6 +698,10 @@
|
||||
RelativePath=".\src\source\DataModelV3\Instance.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\source\DataModelV3\LevelInstance.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
@@ -988,7 +992,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\ReflectionProperty_impl.h"
|
||||
RelativePath=".\src\include\Reflection\ReflectionProperty_impl.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
@@ -999,6 +1003,10 @@
|
||||
RelativePath=".\src\include\DataModelV3\Instance.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\include\DataModelV3\LevelInstance.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
|
||||
64
src/include/DataModelV3/DataModelInstance.h
Normal file
64
src/include/DataModelV3/DataModelInstance.h
Normal file
@@ -0,0 +1,64 @@
|
||||
#include "Instance.h"
|
||||
using namespace B3D;
|
||||
|
||||
#pragma once
|
||||
|
||||
// Instances
|
||||
//#include "WorkspaceInstance.h"
|
||||
#include "LevelInstance.h"
|
||||
//#include "PartInstance.h"
|
||||
//#include "SelectionService.h"
|
||||
//#include "GuiRootInstance.h"
|
||||
//#include "ThumbnailGeneratorInstance.h"
|
||||
//#include "XplicitNgine/XplicitNgine.h"
|
||||
//#include "SoundService.h"
|
||||
//#include "LightingInstance.h"
|
||||
|
||||
// Libraries
|
||||
//#include "rapidxml/rapidxml.hpp"
|
||||
namespace B3D {
|
||||
class DataModelInstance : public Instance
|
||||
{
|
||||
public:
|
||||
DataModelInstance(void);
|
||||
~DataModelInstance(void);
|
||||
void setMessage(std::string);
|
||||
void setMessageBrickCount();
|
||||
void clearMessage();
|
||||
void drawMessage(RenderDevice*);
|
||||
|
||||
// Instance getters
|
||||
// WorkspaceInstance* getWorkspace();
|
||||
LevelInstance* getLevel();
|
||||
// XplicitNgine* getEngine();
|
||||
// ThumbnailGeneratorInstance* getThumbnailGenerator();
|
||||
// SoundService* getSoundService();
|
||||
// LightingInstance* getLighting();
|
||||
|
||||
std::string message;
|
||||
bool showMessage;
|
||||
//Should probably not be here???
|
||||
G3D::GFontRef font;
|
||||
// GuiRootInstance* getGuiRoot();
|
||||
// SelectionService* getSelectionService();
|
||||
// PartInstance* makePart();
|
||||
void clearLevel();
|
||||
void toggleRun();
|
||||
bool isRunning();
|
||||
// void resetEngine();
|
||||
private:
|
||||
bool isBrickCount;
|
||||
Color3 DataModelInstance::bcToRGB(short bc);
|
||||
// Instances
|
||||
// WorkspaceInstance* workspace;
|
||||
LevelInstance* level;
|
||||
// GuiRootInstance* guiRoot;
|
||||
// SelectionService* selectionService;
|
||||
// ThumbnailGeneratorInstance* thumbnailGenerator;
|
||||
// XplicitNgine* xplicitNgine;
|
||||
// SoundService* soundService;
|
||||
// LightingInstance* lightingInstance;
|
||||
bool running;
|
||||
|
||||
};
|
||||
}
|
||||
0
src/include/DataModelV3/GroupInstance.h
Normal file
0
src/include/DataModelV3/GroupInstance.h
Normal file
@@ -5,8 +5,11 @@
|
||||
#include "Reflection/ReflectionProperty.h"
|
||||
#include <G3DAll.h>
|
||||
|
||||
|
||||
namespace B3D
|
||||
{
|
||||
class DataModelInstance;
|
||||
|
||||
class Instance
|
||||
{
|
||||
public:
|
||||
@@ -33,9 +36,13 @@ namespace B3D
|
||||
void removeChild(Instance*);
|
||||
void clearChildren();
|
||||
Instance* getParent();
|
||||
DataModelInstance * getParentDataModel(void);
|
||||
|
||||
//Variables
|
||||
Reflection::ReflectionProperty<std::string> name;
|
||||
bool canDelete;
|
||||
|
||||
|
||||
protected:
|
||||
//Constructor
|
||||
//Used specifically to identify an instance class by an instance class,
|
||||
@@ -45,5 +52,6 @@ namespace B3D
|
||||
//Variables
|
||||
Reflection::ReflectionDataTable * dataTable;
|
||||
Instance * parent;
|
||||
DataModelInstance * parentDataModel;
|
||||
};
|
||||
}
|
||||
|
||||
28
src/include/DataModelV3/LevelInstance.h
Normal file
28
src/include/DataModelV3/LevelInstance.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
#include "Instance.h"
|
||||
namespace B3D{
|
||||
class LevelInstance : public Instance
|
||||
{
|
||||
public:
|
||||
//Constructors
|
||||
LevelInstance(void);
|
||||
~LevelInstance(void);
|
||||
|
||||
//Functions
|
||||
void winCondition();
|
||||
void loseCondition();
|
||||
void pauseCondition();
|
||||
void drawCondition();
|
||||
void Step(SimTime sdt);
|
||||
|
||||
//Values
|
||||
Reflection::ReflectionProperty<bool> highScoreIsGood;
|
||||
Reflection::ReflectionProperty<int> timerUpAction;
|
||||
Reflection::ReflectionProperty<int> timerAffectsScore;
|
||||
Reflection::ReflectionProperty<bool> runOnOpen;
|
||||
Reflection::ReflectionProperty<float> timer;
|
||||
Reflection::ReflectionProperty<int> score;
|
||||
Reflection::ReflectionProperty<std::string> winMessage;
|
||||
Reflection::ReflectionProperty<std::string> loseMessage;
|
||||
};
|
||||
}
|
||||
0
src/include/DataModelV3/PVInstance.h
Normal file
0
src/include/DataModelV3/PVInstance.h
Normal file
0
src/include/DataModelV3/PartInstance.h
Normal file
0
src/include/DataModelV3/PartInstance.h
Normal file
0
src/include/DataModelV3/WorkspaceInstance.h
Normal file
0
src/include/DataModelV3/WorkspaceInstance.h
Normal file
@@ -4,40 +4,64 @@ namespace Enum
|
||||
{
|
||||
namespace SurfaceType
|
||||
{
|
||||
enum Value {
|
||||
Smooth = 0, Bumps = 1, Hinge = 2, Motor = 3, StepperMotor = 4, Spawn = 5
|
||||
static const char* STR_TABLE[] = {
|
||||
"Smooth", "Bumps", "Hinge",
|
||||
"Motor", "StepperMotor", "Spawn"
|
||||
};
|
||||
enum Value {
|
||||
Smooth = 0, Bumps = 1, Hinge = 2, Motor = 3, StepperMotor = 4, Spawn = 5, LENGTH = 6
|
||||
};
|
||||
|
||||
}
|
||||
namespace Shape
|
||||
{
|
||||
static const char* STR_TABLE[] = {
|
||||
"Ball", "Block", "Cylinder"
|
||||
};
|
||||
enum Value {
|
||||
Ball = 0, Block = 1, Cylinder = 2
|
||||
Ball = 0, Block = 1, Cylinder = 2, LENGTH = 3
|
||||
};
|
||||
}
|
||||
namespace Controller
|
||||
{
|
||||
static const char* STR_TABLE[] = {
|
||||
"None", "KeyboardRight", "KeyboardLeft", "Joypad1",
|
||||
"Joypad2", "Chase", "Flee"
|
||||
};
|
||||
enum Value {
|
||||
Player = 7, KeyboardRight = 1, KeyboardLeft = 2, Joypad1 = 3, Joypad2 = 4, Chase = 5, Flee = 6, None = 0
|
||||
None = 0, KeyboardRight = 1, KeyboardLeft = 2, Joypad1 = 3, Joypad2 = 4, Chase = 5, Flee = 6, LENGTH=7
|
||||
};
|
||||
}
|
||||
namespace ActionType
|
||||
{
|
||||
static const char* STR_TABLE[] = {
|
||||
"Nothing", "Pause", "Lose", "Draw", "Win"
|
||||
};
|
||||
enum Value {
|
||||
Nothing = 0, Pause = 1, Lose = 2, Draw = 3, Win = 4
|
||||
Nothing = 0, Pause = 1, Lose = 2, Draw = 3, Win = 4, LENGTH = 5
|
||||
};
|
||||
}
|
||||
namespace AffectType
|
||||
{
|
||||
static const char* STR_TABLE[] = {
|
||||
"NoChange", "Increase", "Decrease"
|
||||
};
|
||||
enum Value {
|
||||
NoChange = 0, Increase = 1, Decrease = 2
|
||||
NoChange = 0, Increase = 1, Decrease = 2, LENGTH = 3
|
||||
};
|
||||
}
|
||||
namespace Sound
|
||||
{
|
||||
static const char* STR_TABLE[] = {
|
||||
"NoSound", "Victory", "Boing", "Bomb",
|
||||
"Ping", "Break", "Splat", "Swoosh",
|
||||
"Snap", "Page", "Click", "Clock", "Step", "StepOn"
|
||||
};
|
||||
enum Value {
|
||||
NoSound = 0, Victory = 1, Boing = 2, Bomb = 3,
|
||||
Ping = 4, Break = 5, Splat = 6, Swoosh = 7,
|
||||
Snap = 8, Page = 9, Click = 10, Clock = 11, Step = 12, StepOn = 13,
|
||||
LENGTH = 14
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,21 @@
|
||||
#pragma once
|
||||
#include "ErrorFunctions.h"
|
||||
//BE WARNED, IF YOU TOUCH REFLECTION YOUR BUILD WILL TAKE AGES
|
||||
|
||||
namespace B3D{
|
||||
namespace Reflection{
|
||||
//I do not like this... Structs?
|
||||
class EnumMeta {
|
||||
public:
|
||||
EnumMeta(int maxLength, const char ** nameValues)
|
||||
{
|
||||
this->maxLength = maxLength;
|
||||
this->nameValues = nameValues;
|
||||
}
|
||||
int maxLength;
|
||||
const char ** nameValues;
|
||||
};
|
||||
|
||||
enum ReflectionType {
|
||||
TYPE_INT = 0,
|
||||
TYPE_FLOAT = 1,
|
||||
|
||||
@@ -16,19 +16,22 @@ namespace B3D{
|
||||
std::string key;
|
||||
T * value;
|
||||
ReflectionType type;
|
||||
ReflectionProperty(std::string key, T * value, ReflectionType type, ReflectionDataTable * containerTable);
|
||||
ReflectionProperty(std::string key, T * valuePtr, ReflectionType type, ReflectionDataTable * containerTable, void* extData = NULL, bool archivable = true, bool locked = false, bool propertyHidden = false);
|
||||
ReflectionProperty(std::string key, T defaultValue, ReflectionType type, ReflectionDataTable * containerTable, void* extData = NULL, bool archivable = true, bool locked = false, bool propertyHidden = false);
|
||||
ReflectionProperty(void);
|
||||
~ReflectionProperty(void);
|
||||
void dispose();
|
||||
|
||||
private:
|
||||
std::string propertyName;
|
||||
bool archivable;
|
||||
bool locked;
|
||||
bool propertyHidden;
|
||||
void* extData;
|
||||
ReflectionDataTable * containerTable;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
//***really*** wanted to avoid implementing this inside of the header
|
||||
#include "ReflectionProperty_imp.h"
|
||||
#include "ReflectionProperty_impl.h"
|
||||
44
src/include/Reflection/ReflectionProperty_impl.h
Normal file
44
src/include/Reflection/ReflectionProperty_impl.h
Normal file
@@ -0,0 +1,44 @@
|
||||
using namespace B3D::Reflection;
|
||||
|
||||
template<class T>
|
||||
ReflectionProperty<T>::ReflectionProperty(std::string key, T * value, ReflectionType type, ReflectionDataTable * containerTable, void* extData = NULL, bool archivable = true, bool locked = false, bool propertyHidden = false)
|
||||
{
|
||||
this->value = value;
|
||||
this->type = type;
|
||||
this->containerTable = containerTable;
|
||||
this->locked = locked;
|
||||
this->archivable = archivable;
|
||||
this->propertyHidden = propertyHidden;
|
||||
this->extData = extData;
|
||||
containerTable->mapProperty(key, (ReflectionProperty<void*>*)this);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
ReflectionProperty<T>::ReflectionProperty(std::string key, T value, ReflectionType type, ReflectionDataTable * containerTable, void* extData = NULL, bool archivable = true, bool locked = false, bool propertyHidden = false)
|
||||
{
|
||||
this->value = new T(value);
|
||||
this->type = type;
|
||||
this->containerTable = containerTable;
|
||||
this->locked = locked;
|
||||
this->archivable = archivable;
|
||||
this->propertyHidden = propertyHidden;
|
||||
this->extData = extData;
|
||||
containerTable->mapProperty(key, (ReflectionProperty<void*>*)this);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
ReflectionProperty<T>::ReflectionProperty(void)
|
||||
{
|
||||
}
|
||||
|
||||
template<class T>
|
||||
ReflectionProperty<T>::~ReflectionProperty(void)
|
||||
{
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void ReflectionProperty<T>::dispose()
|
||||
{
|
||||
delete value;
|
||||
value = NULL;
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
using namespace B3D::Reflection;
|
||||
|
||||
template<class T>
|
||||
ReflectionProperty<T>::ReflectionProperty(std::string key, T * value, ReflectionType type, ReflectionDataTable * containerTable)
|
||||
{
|
||||
this->value = value;
|
||||
this->type = type;
|
||||
this->containerTable = containerTable;
|
||||
this->locked = locked;
|
||||
this->archivable = archivable;
|
||||
this->propertyHidden = propertyHidden;
|
||||
containerTable->mapProperty(key, (ReflectionProperty<void*>*)this);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
ReflectionProperty<T>::ReflectionProperty(void)
|
||||
{
|
||||
}
|
||||
|
||||
template<class T>
|
||||
ReflectionProperty<T>::~ReflectionProperty(void)
|
||||
{
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void ReflectionProperty<T>::dispose()
|
||||
{
|
||||
delete value;
|
||||
value = NULL;
|
||||
}
|
||||
341
src/source/DataModelV3/DataModelInstance.cpp
Normal file
341
src/source/DataModelV3/DataModelInstance.cpp
Normal file
@@ -0,0 +1,341 @@
|
||||
#include "DataModelV3/DataModelInstance.h"
|
||||
using namespace B3D;
|
||||
|
||||
DataModelInstance::DataModelInstance(void)
|
||||
{
|
||||
// Instances
|
||||
Instance::Instance("DataModel");
|
||||
parentDataModel = this;
|
||||
//workspace = new WorkspaceInstance();
|
||||
//guiRoot = new GuiRootInstance();
|
||||
level = new LevelInstance();
|
||||
//thumbnailGenerator = new ThumbnailGeneratorInstance();
|
||||
//soundService = new SoundService();
|
||||
//lightingInstance = new LightingInstance();
|
||||
|
||||
//selectionService = new SelectionService();
|
||||
//selectionService->setPropertyWindow(g_usableApp->_propWindow);
|
||||
showMessage = false;
|
||||
canDelete = false;
|
||||
|
||||
// Parent stuff
|
||||
//workspace->setParent(this);
|
||||
level->setParent(this);
|
||||
//soundService->setParent(this);
|
||||
//lightingInstance->setParent(this);
|
||||
|
||||
running = false;
|
||||
//xplicitNgine = NULL;
|
||||
//resetEngine();
|
||||
}
|
||||
|
||||
//TODO implement
|
||||
/*
|
||||
void DataModelInstance::resetEngine()
|
||||
{
|
||||
if(xplicitNgine != NULL)
|
||||
delete xplicitNgine;
|
||||
xplicitNgine = new XplicitNgine();
|
||||
g_xplicitNgine = xplicitNgine;
|
||||
for(size_t i = 0; i < getWorkspace()->partObjects.size(); i++)
|
||||
{
|
||||
PartInstance* partInstance = getWorkspace()->partObjects[i];
|
||||
partInstance->physBody = NULL;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
//TODO implement
|
||||
/*
|
||||
XplicitNgine * DataModelInstance::getEngine()
|
||||
{
|
||||
return xplicitNgine;
|
||||
}*/
|
||||
|
||||
void DataModelInstance::toggleRun()
|
||||
{
|
||||
running = !running;
|
||||
|
||||
//TODO implement (in RunService!!!)
|
||||
//if(!running)
|
||||
//resetEngine();
|
||||
}
|
||||
|
||||
bool DataModelInstance::isRunning()
|
||||
{
|
||||
return running;
|
||||
}
|
||||
|
||||
DataModelInstance::~DataModelInstance(void)
|
||||
{
|
||||
//TODO implement
|
||||
//delete xplicitNgine;
|
||||
}
|
||||
|
||||
void DataModelInstance::clearLevel()
|
||||
{
|
||||
running = false;
|
||||
//TODO implement
|
||||
/*Instance * goButton = this->getGuiRoot()->findFirstChild("go");
|
||||
if(goButton != NULL){
|
||||
if(ToggleImageButtonInstance* goButtonReal = dynamic_cast<ToggleImageButtonInstance*>(goButton))
|
||||
{
|
||||
goButtonReal->checked = false;
|
||||
}
|
||||
}
|
||||
selectionService->clearSelection();
|
||||
selectionService->addSelected(this);
|
||||
workspace->clearChildren();*/
|
||||
}
|
||||
|
||||
Color3 DataModelInstance::bcToRGB(short bc)
|
||||
{
|
||||
switch(bc)
|
||||
{
|
||||
case 1: return Color3(0.94901967048645F,0.95294123888016F,0.95294123888016F);
|
||||
case 2: return Color3(0.63137257099152F,0.64705884456635F,0.63529413938522F);
|
||||
case 3: return Color3(0.9764706492424F,0.91372555494308F,0.60000002384186F);
|
||||
case 5: return Color3(0.84313732385635F,0.77254909276962F,0.60392159223557F);
|
||||
case 6: return Color3(0.7607843875885F,0.85490202903748F,0.72156864404678F);
|
||||
case 9: return Color3(0.90980398654938F,0.7294117808342F,0.78431379795074F);
|
||||
case 11: return Color3(0.50196081399918F,0.73333334922791F,0.85882359743118F);
|
||||
case 12: return Color3(0.79607850313187F,0.51764708757401F,0.258823543787F);
|
||||
case 18: return Color3(0.80000007152557F,0.55686277151108F,0.41176474094391F);
|
||||
case 21: return Color3(0.76862752437592F,0.15686275064945F,0.10980392992496F);
|
||||
case 22: return Color3(0.76862752437592F,0.43921571969986F,0.62745100259781F);
|
||||
case 23: return Color3(0.050980396568775F,0.41176474094391F,0.6745098233223F);
|
||||
case 24: return Color3(0.96078437566757F,0.80392163991928F,0.18823531270027F);
|
||||
case 25: return Color3(0.38431376218796F,0.27843138575554F,0.19607844948769F);
|
||||
case 26: return Color3(0.10588236153126F,0.16470588743687F,0.20784315466881F);
|
||||
case 27: return Color3(0.42745101451874F,0.43137258291245F,0.42352944612503F);
|
||||
case 28: return Color3(0.15686275064945F,0.49803924560547F,0.27843138575554F);
|
||||
case 29: return Color3(0.63137257099152F,0.76862752437592F,0.54901963472366F);
|
||||
case 36: return Color3(0.95294123888016F,0.8117647767067F,0.60784316062927F);
|
||||
case 37: return Color3(0.29411765933037F,0.59215688705444F,0.29411765933037F);
|
||||
case 38: return Color3(0.62745100259781F,0.37254902720451F,0.20784315466881F);
|
||||
case 39: return Color3(0.75686281919479F,0.79215693473816F,0.8705883026123F);
|
||||
case 40: return Color3(0.92549026012421F,0.92549026012421F,0.92549026012421F);
|
||||
case 41: return Color3(0.80392163991928F,0.32941177487373F,0.29411765933037F);
|
||||
case 42: return Color3(0.75686281919479F,0.87450987100601F,0.94117653369904F);
|
||||
case 43: return Color3(0.48235297203064F,0.71372550725937F,0.90980398654938F);
|
||||
case 44: return Color3(0.96862751245499F,0.94509810209274F,0.55294120311737F);
|
||||
case 45: return Color3(0.70588237047195F,0.82352948188782F,0.89411771297455F);
|
||||
case 47: return Color3(0.85098046064377F,0.52156865596771F,0.42352944612503F);
|
||||
case 48: return Color3(0.51764708757401F,0.71372550725937F,0.55294120311737F);
|
||||
case 49: return Color3(0.97254908084869F,0.94509810209274F,0.51764708757401F);
|
||||
case 50: return Color3(0.92549026012421F,0.90980398654938F,0.8705883026123F);
|
||||
case 100: return Color3(0.93333339691162F,0.76862752437592F,0.71372550725937F);
|
||||
case 101: return Color3(0.85490202903748F,0.52549022436142F,0.47843140363693F);
|
||||
case 102: return Color3(0.43137258291245F,0.60000002384186F,0.79215693473816F);
|
||||
case 103: return Color3(0.78039222955704F,0.75686281919479F,0.71764707565308F);
|
||||
case 104: return Color3(0.41960787773132F,0.19607844948769F,0.48627454042435F);
|
||||
case 105: return Color3(0.88627457618713F,0.60784316062927F,0.25098040699959F);
|
||||
case 106: return Color3(0.85490202903748F,0.52156865596771F,0.2549019753933F);
|
||||
case 107: return Color3(0,0.56078433990479F,0.61176472902298F);
|
||||
case 108: return Color3(0.4078431725502F,0.36078432202339F,0.26274511218071F);
|
||||
case 110: return Color3(0.26274511218071F,0.32941177487373F,0.57647061347961F);
|
||||
case 111: return Color3(0.74901962280273F,0.71764707565308F,0.69411766529083F);
|
||||
case 112: return Color3(0.4078431725502F,0.45490199327469F,0.6745098233223F);
|
||||
case 113: return Color3(0.89411771297455F,0.678431391716F,0.78431379795074F);
|
||||
case 115: return Color3(0.78039222955704F,0.82352948188782F,0.23529413342476F);
|
||||
case 116: return Color3(0.33333334326744F,0.64705884456635F,0.68627452850342F);
|
||||
case 118: return Color3(0.71764707565308F,0.84313732385635F,0.83529418706894F);
|
||||
case 119: return Color3(0.64313727617264F,0.74117648601532F,0.27843138575554F);
|
||||
case 120: return Color3(0.85098046064377F,0.89411771297455F,0.65490198135376F);
|
||||
case 121: return Color3(0.90588241815567F,0.6745098233223F,0.34509804844856F);
|
||||
case 123: return Color3(0.82745105028152F,0.43529415130615F,0.29803922772408F);
|
||||
case 124: return Color3(0.57254904508591F,0.22352942824364F,0.47058826684952F);
|
||||
case 125: return Color3(0.91764712333679F,0.72156864404678F,0.57254904508591F);
|
||||
case 126: return Color3(0.64705884456635F,0.64705884456635F,0.79607850313187F);
|
||||
case 127: return Color3(0.86274516582489F,0.73725491762161F,0.50588238239288F);
|
||||
case 128: return Color3(0.68235296010971F,0.47843140363693F,0.34901961684227F);
|
||||
case 131: return Color3(0.61176472902298F,0.63921570777893F,0.65882354974747F);
|
||||
case 133: return Color3(0.83529418706894F,0.45098042488098F,0.23921570181847F);
|
||||
case 134: return Color3(0.84705889225006F,0.8666667342186F,0.33725491166115F);
|
||||
case 135: return Color3(0.45490199327469F,0.52549022436142F,0.61568629741669F);
|
||||
case 136: return Color3(0.52941179275513F,0.48627454042435F,0.56470590829849F);
|
||||
case 137: return Color3(0.87843143939972F,0.59607845544815F,0.39215689897537F);
|
||||
case 138: return Color3(0.58431375026703F,0.54117649793625F,0.45098042488098F);
|
||||
case 140: return Color3(0.12549020349979F,0.22745099663734F,0.33725491166115F);
|
||||
case 141: return Color3(0.15294118225574F,0.27450981736183F,0.17647059261799F);
|
||||
case 143: return Color3(0.8117647767067F,0.88627457618713F,0.96862751245499F);
|
||||
case 145: return Color3(0.47450983524323F,0.53333336114883F,0.63137257099152F);
|
||||
case 146: return Color3(0.58431375026703F,0.55686277151108F,0.63921570777893F);
|
||||
case 147: return Color3(0.57647061347961F,0.52941179275513F,0.40392160415649F);
|
||||
case 148: return Color3(0.34117648005486F,0.34509804844856F,0.34117648005486F);
|
||||
case 149: return Color3(0.086274512112141F,0.11372549831867F,0.19607844948769F);
|
||||
case 150: return Color3(0.67058825492859F,0.678431391716F,0.6745098233223F);
|
||||
case 151: return Color3(0.47058826684952F,0.56470590829849F,0.50980395078659F);
|
||||
case 153: return Color3(0.58431375026703F,0.47450983524323F,0.46666669845581F);
|
||||
case 154: return Color3(0.48235297203064F,0.1803921610117F,0.1843137294054F);
|
||||
case 157: return Color3(1,0.96470594406128F,0.48235297203064F);
|
||||
case 158: return Color3(0.88235300779343F,0.64313727617264F,0.7607843875885F);
|
||||
case 168: return Color3(0.4588235616684F,0.42352944612503F,0.38431376218796F);
|
||||
case 176: return Color3(0.59215688705444F,0.41176474094391F,0.35686275362968F);
|
||||
case 178: return Color3(0.70588237047195F,0.51764708757401F,0.33333334326744F);
|
||||
case 179: return Color3(0.53725492954254F,0.52941179275513F,0.53333336114883F);
|
||||
case 180: return Color3(0.84313732385635F,0.66274511814117F,0.29411765933037F);
|
||||
case 190: return Color3(0.9764706492424F,0.83921575546265F,0.1803921610117F);
|
||||
case 191: return Color3(0.90980398654938F,0.67058825492859F,0.17647059261799F);
|
||||
case 192: return Color3(0.41176474094391F,0.25098040699959F,0.15686275064945F);
|
||||
case 193: return Color3(0.8117647767067F,0.37647062540054F,0.14117647707462F);
|
||||
case 195: return Color3(0.27450981736183F,0.40392160415649F,0.64313727617264F);
|
||||
case 196: return Color3(0.13725490868092F,0.27843138575554F,0.54509806632996F);
|
||||
case 198: return Color3(0.55686277151108F,0.258823543787F,0.52156865596771F);
|
||||
case 199: return Color3(0.38823533058167F,0.37254902720451F,0.38431376218796F);
|
||||
case 200: return Color3(0.50980395078659F,0.54117649793625F,0.3647058904171F);
|
||||
case 208: return Color3(0.89803928136826F,0.89411771297455F,0.87450987100601F);
|
||||
case 209: return Color3(0.69019609689713F,0.55686277151108F,0.26666668057442F);
|
||||
case 210: return Color3(0.43921571969986F,0.58431375026703F,0.47058826684952F);
|
||||
case 211: return Color3(0.47450983524323F,0.70980393886566F,0.70980393886566F);
|
||||
case 212: return Color3(0.6235294342041F,0.76470595598221F,0.91372555494308F);
|
||||
case 213: return Color3(0.42352944612503F,0.50588238239288F,0.71764707565308F);
|
||||
case 216: return Color3(0.56078433990479F,0.29803922772408F,0.16470588743687F);
|
||||
case 217: return Color3(0.48627454042435F,0.36078432202339F,0.27450981736183F);
|
||||
case 218: return Color3(0.58823531866074F,0.43921571969986F,0.6235294342041F);
|
||||
case 219: return Color3(0.41960787773132F,0.38431376218796F,0.60784316062927F);
|
||||
case 220: return Color3(0.65490198135376F,0.66274511814117F,0.80784320831299F);
|
||||
case 221: return Color3(0.80392163991928F,0.38431376218796F,0.59607845544815F);
|
||||
case 222: return Color3(0.89411771297455F,0.678431391716F,0.78431379795074F);
|
||||
case 223: return Color3(0.86274516582489F,0.56470590829849F,0.58431375026703F);
|
||||
case 224: return Color3(0.94117653369904F,0.83529418706894F,0.62745100259781F);
|
||||
case 225: return Color3(0.9215686917305F,0.72156864404678F,0.49803924560547F);
|
||||
case 226: return Color3(0.99215692281723F,0.91764712333679F,0.55294120311737F);
|
||||
case 232: return Color3(0.49019610881805F,0.73333334922791F,0.8666667342186F);
|
||||
case 268: return Color3(0.2039215862751F,0.16862745583057F,0.4588235616684F);
|
||||
case 1001: return Color3(0.97254908084869F,0.97254908084869F,0.97254908084869F);
|
||||
case 1002: return Color3(0.80392163991928F,0.80392163991928F,0.80392163991928F);
|
||||
case 1003: return Color3(0.066666670143604F,0.066666670143604F,0.066666670143604F);
|
||||
case 1004: return Color3(1,0,0);
|
||||
case 1005: return Color3(1,0.68627452850342F,0);
|
||||
case 1006: return Color3(0.70588237047195F,0.50196081399918F,1);
|
||||
case 1007: return Color3(0.63921570777893F,0.29411765933037F,0.29411765933037F);
|
||||
case 1008: return Color3(0.75686281919479F,0.74509805440903F,0.258823543787F);
|
||||
case 1009: return Color3(1,1,0);
|
||||
case 1010: return Color3(0,0,1);
|
||||
case 1011: return Color3(0,0.12549020349979F,0.37647062540054F);
|
||||
case 1012: return Color3(0.1294117718935F,0.32941177487373F,0.72549021244049F);
|
||||
case 1013: return Color3(0.015686275437474F,0.68627452850342F,0.92549026012421F);
|
||||
case 1014: return Color3(0.66666668653488F,0.33333334326744F,0);
|
||||
case 1015: return Color3(0.66666668653488F,0,0.66666668653488F);
|
||||
case 1016: return Color3(1,0.40000003576279F,0.80000007152557F);
|
||||
case 1017: return Color3(1,0.68627452850342F,0);
|
||||
case 1018: return Color3(0.070588238537312F,0.93333339691162F,0.83137261867523F);
|
||||
case 1019: return Color3(0,1,1);
|
||||
case 1020: return Color3(0,1,0);
|
||||
case 1021: return Color3(0.22745099663734F,0.49019610881805F,0.082352943718433F);
|
||||
case 1022: return Color3(0.49803924560547F,0.55686277151108F,0.39215689897537F);
|
||||
case 1023: return Color3(0.54901963472366F,0.35686275362968F,0.6235294342041F);
|
||||
case 1024: return Color3(0.68627452850342F,0.8666667342186F,1);
|
||||
case 1025: return Color3(1,0.78823536634445F,0.78823536634445F);
|
||||
case 1026: return Color3(0.69411766529083F,0.65490198135376F,1);
|
||||
case 1027: return Color3(0.6235294342041F,0.95294123888016F,0.91372555494308F);
|
||||
case 1028: return Color3(0.80000007152557F,1,0.80000007152557F);
|
||||
case 1029: return Color3(1,1,0.80000007152557F);
|
||||
case 1030: return Color3(1,0.80000007152557F,0.60000002384186F);
|
||||
case 1031: return Color3(0.38431376218796F,0.14509804546833F,0.81960791349411F);
|
||||
case 1032: return Color3(1,0,0.74901962280273F);
|
||||
default: return Color3::gray();
|
||||
}
|
||||
}
|
||||
|
||||
void DataModelInstance::setMessage(std::string msg)
|
||||
{
|
||||
message = msg;
|
||||
isBrickCount = false;
|
||||
showMessage = true;
|
||||
}
|
||||
|
||||
void DataModelInstance::clearMessage()
|
||||
{
|
||||
showMessage = false;
|
||||
isBrickCount = false;
|
||||
message = "";
|
||||
}
|
||||
|
||||
void DataModelInstance::setMessageBrickCount()
|
||||
{
|
||||
isBrickCount = true;
|
||||
showMessage = true;
|
||||
}
|
||||
|
||||
void DataModelInstance::drawMessage(RenderDevice* rd)
|
||||
{
|
||||
//TODO implement
|
||||
/*if(isBrickCount)
|
||||
{
|
||||
int brickCount = 0;
|
||||
int instCount = 0;
|
||||
std::vector<Instance*> inst = getAllChildren();
|
||||
for(size_t i = 0; i < inst.size(); i++)
|
||||
{
|
||||
if(PartInstance* moveTo = dynamic_cast<PartInstance*>(inst.at(i)))
|
||||
{
|
||||
brickCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
instCount++;
|
||||
}
|
||||
}
|
||||
char brkc[12];
|
||||
_snprintf(brkc, 12, "%d", brickCount);
|
||||
char instc[12];
|
||||
_snprintf(instc, 12, "%d", instCount);
|
||||
message = "Bricks: ";
|
||||
message += brkc;
|
||||
message += " Snaps: ";
|
||||
message += instc;
|
||||
}
|
||||
if(showMessage && !font.isNull())
|
||||
{
|
||||
int x = rd->getWidth()/2;
|
||||
int y = rd->getHeight()/2;
|
||||
int width = rd->getWidth()/2 + 100;
|
||||
int height = width / 3;
|
||||
Draw::box(Box(Vector3(x-(width/2), y-(height/2), 0), Vector3(x+(width/2), y+(height/2), 0)), rd, Color4::fromARGB(0x55B2B2B2), Color3::fromARGB(0xB2B2B2));
|
||||
font->draw2D(rd, message, Vector2(x,y), height/8, Color3::white(), Color4::clear(), GFont::XALIGN_CENTER, GFont::YALIGN_CENTER);
|
||||
}*/
|
||||
}
|
||||
|
||||
//TODO implement
|
||||
/*WorkspaceInstance* DataModelInstance::getWorkspace()
|
||||
{
|
||||
return workspace;
|
||||
}*/
|
||||
|
||||
//TODO implement
|
||||
/*GuiRootInstance* DataModelInstance::getGuiRoot()
|
||||
{
|
||||
return guiRoot;
|
||||
}*/
|
||||
|
||||
//TODO implement
|
||||
/*SelectionService* DataModelInstance::getSelectionService()
|
||||
{
|
||||
return selectionService;
|
||||
}*/
|
||||
|
||||
//TODO implement
|
||||
/*LevelInstance* DataModelInstance::getLevel()
|
||||
{
|
||||
return level;
|
||||
}*/
|
||||
|
||||
//TODO implement
|
||||
/*ThumbnailGeneratorInstance* DataModelInstance::getThumbnailGenerator()
|
||||
{
|
||||
return thumbnailGenerator;
|
||||
}*/
|
||||
|
||||
//TODO implement
|
||||
/*SoundService* DataModelInstance::getSoundService()
|
||||
{
|
||||
return soundService;
|
||||
}*/
|
||||
|
||||
//TODO implement
|
||||
/*LightingInstance* DataModelInstance::getLighting()
|
||||
{
|
||||
return lightingInstance;
|
||||
}*/
|
||||
3
src/source/DataModelV3/GroupInstance.cpp
Normal file
3
src/source/DataModelV3/GroupInstance.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
#include "DataModelV3/GroupInstance.h"
|
||||
|
||||
|
||||
@@ -5,14 +5,15 @@ using namespace B3D;
|
||||
Instance::Instance(std::string className)
|
||||
{
|
||||
this->parent = NULL;
|
||||
this->parentDataModel = NULL;
|
||||
this->dataTable = new Reflection::ReflectionDataTable(this, className);
|
||||
this->name = Reflection::ReflectionProperty<std::string>("Name", new std::string("Level"), Reflection::TYPE_STRING, dataTable);
|
||||
Reflection::ReflectionProperty<std::string>("Name", new std::string("Level"), Reflection::TYPE_STRING, dataTable);
|
||||
this->name = Reflection::ReflectionProperty<std::string>("Name", "Level", Reflection::TYPE_STRING, dataTable);
|
||||
canDelete = true;
|
||||
}
|
||||
|
||||
Instance::Instance(void)
|
||||
{
|
||||
Instance::Instance("BaseInstance");
|
||||
Instance::Instance("");
|
||||
}
|
||||
|
||||
Instance::~Instance(void)
|
||||
@@ -91,6 +92,7 @@ void Instance::setParent(Instance* newParent)
|
||||
if(newParent != NULL)
|
||||
{
|
||||
newParent->addChild(this);
|
||||
parentDataModel = newParent->getParentDataModel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,6 +101,11 @@ Instance* Instance::getParent()
|
||||
return parent;
|
||||
}
|
||||
|
||||
DataModelInstance* Instance::getParentDataModel()
|
||||
{
|
||||
return parentDataModel;
|
||||
}
|
||||
|
||||
void Instance::addChild(Instance* newChild)
|
||||
{
|
||||
children.push_back(newChild);
|
||||
|
||||
93
src/source/DataModelV3/LevelInstance.cpp
Normal file
93
src/source/DataModelV3/LevelInstance.cpp
Normal file
@@ -0,0 +1,93 @@
|
||||
//#include "DataModelV3/DataModelInstance.h"
|
||||
#include "DataModelV3/LevelInstance.h"
|
||||
#include "Enum.h"
|
||||
using namespace B3D;
|
||||
|
||||
LevelInstance::LevelInstance(void)
|
||||
{
|
||||
Instance::Instance("LevelService");
|
||||
*name.value = "Level";
|
||||
|
||||
//Reflection values
|
||||
winMessage = Reflection::ReflectionProperty<std::string>("WinMessage", "You Won!", TYPE_STRING, this->dataTable);
|
||||
loseMessage = Reflection::ReflectionProperty<std::string>("LoseMessage", "You Lost. Try Again", TYPE_STRING, this->dataTable);
|
||||
timer = Reflection::ReflectionProperty<float>("InitialTimerValue", 60.0F, TYPE_FLOAT, this->dataTable);
|
||||
score = Reflection::ReflectionProperty<int>("InitialScoreValue", 0, TYPE_INT, this->dataTable);
|
||||
highScoreIsGood = Reflection::ReflectionProperty<bool>("HighScoreIsGood", false, TYPE_BOOLEAN, this->dataTable);
|
||||
runOnOpen = Reflection::ReflectionProperty<bool>("RunOnOpen", false, TYPE_BOOLEAN, this->dataTable);
|
||||
timerUpAction = Reflection::ReflectionProperty<int>("TimerUpAction", Enum::ActionType::Nothing, TYPE_ENUM, this->dataTable,
|
||||
new EnumMeta(Enum::ActionType::LENGTH, Enum::ActionType::STR_TABLE));
|
||||
timerAffectsScore = Reflection::ReflectionProperty<int>("TimerAffectsScore", Enum::AffectType::NoChange, TYPE_ENUM, this->dataTable,
|
||||
new EnumMeta(Enum::ActionType::LENGTH, Enum::ActionType::STR_TABLE));
|
||||
|
||||
canDelete = false;
|
||||
}
|
||||
|
||||
LevelInstance::~LevelInstance(void)
|
||||
{
|
||||
}
|
||||
|
||||
void LevelInstance::winCondition()
|
||||
{
|
||||
//DataModelInstance* DataModel = (DataModelInstance*)getParent(); //If level parent gets changed to something other than Datamodel it could cause nasty data corruption bugs
|
||||
//DataModel->setMessage(winMessage);
|
||||
//DataModel->toggleRun();
|
||||
}
|
||||
|
||||
void LevelInstance::loseCondition()
|
||||
{
|
||||
//DataModelInstance* DataModel = (DataModelInstance*)getParent();
|
||||
//DataModel->setMessage(loseMessage);
|
||||
//DataModel->toggleRun();
|
||||
}
|
||||
|
||||
void LevelInstance::pauseCondition()
|
||||
{
|
||||
//DataModelInstance* DataModel = (DataModelInstance*)getParent();
|
||||
//DataModel->toggleRun();
|
||||
}
|
||||
|
||||
void LevelInstance::drawCondition()
|
||||
{
|
||||
//DataModelInstance* DataModel = (DataModelInstance*)getParent();
|
||||
//DataModel->toggleRun();
|
||||
}
|
||||
|
||||
void LevelInstance::Step(SimTime sdt)
|
||||
{
|
||||
switch(*timerAffectsScore.value)
|
||||
{
|
||||
case Enum::AffectType::NoChange:
|
||||
break;
|
||||
case Enum::AffectType::Increase:
|
||||
*score.value += 1;
|
||||
break;
|
||||
case Enum::AffectType::Decrease:
|
||||
if (*score.value > 0)
|
||||
*score.value -= 1;
|
||||
break;
|
||||
}
|
||||
if (*timer.value >= sdt){
|
||||
*score.value -= sdt;
|
||||
}
|
||||
else{
|
||||
*timer.value = 0.0f;
|
||||
switch(*timerUpAction.value)
|
||||
{
|
||||
case Enum::ActionType::Nothing:
|
||||
break;
|
||||
case Enum::ActionType::Pause:
|
||||
pauseCondition();
|
||||
break;
|
||||
case Enum::ActionType::Lose:
|
||||
loseCondition();
|
||||
break;
|
||||
case Enum::ActionType::Draw:
|
||||
drawCondition();
|
||||
break;
|
||||
case Enum::ActionType::Win:
|
||||
winCondition();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
src/source/DataModelV3/PVInstance.cpp
Normal file
3
src/source/DataModelV3/PVInstance.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
#include "DataModelV3/PVInstance.h"
|
||||
|
||||
|
||||
3
src/source/DataModelV3/PartInstance.cpp
Normal file
3
src/source/DataModelV3/PartInstance.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
#include "DataModelV3/PartInstance.h"
|
||||
|
||||
|
||||
3
src/source/DataModelV3/WorkspaceInstance.cpp
Normal file
3
src/source/DataModelV3/WorkspaceInstance.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
#include "DataModelV3/WorkspaceInstance.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user