-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
167 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include "ItemController.h" | ||
#include <engine/World.h> | ||
#include <components/Vob.h> | ||
|
||
using namespace Logic; | ||
|
||
ItemController::ItemController(World::WorldInstance& world, Handle::EntityHandle entity, Daedalus::GameState::ItemHandle scriptInstance) : | ||
Controller(world, entity) | ||
{ | ||
m_ScriptState.scriptInstance = scriptInstance; | ||
} | ||
|
||
void Logic::ItemController::updateVobFromScript() | ||
{ | ||
Daedalus::GEngineClasses::C_Item& item = m_World.getScriptEngine().getGameState().getItem(m_ScriptState.scriptInstance); | ||
Vob::VobInformation vob = Vob::asVob(m_World, m_Entity); | ||
|
||
// Update visual | ||
Vob::setVisual(vob, item.visual); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma once | ||
#include <daedalus/DaedalusGameState.h> | ||
#include <set> | ||
#include "Controller.h" | ||
#include "LogicDef.h" | ||
|
||
namespace Logic | ||
{ | ||
class ItemController : public Controller | ||
{ | ||
public: | ||
/** | ||
* @param world World of the underlaying entity | ||
* @param entity Entity owning this controller | ||
*/ | ||
ItemController(World::WorldInstance& world, Handle::EntityHandle entity, Daedalus::GameState::ItemHandle scriptInstance); | ||
|
||
/** | ||
* Updates this vob from the script-side values (visual, etc) | ||
*/ | ||
void updateVobFromScript(); | ||
|
||
protected: | ||
|
||
struct { | ||
Daedalus::GameState::ItemHandle scriptInstance; | ||
}m_ScriptState; | ||
|
||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters