1234567891011121314151617181920212223242526272829303132333435 |
- #include "ItemEntity.h"
- #include "ItemSlot.h"
- #include "Globals.h"
- ItemEntity::ItemEntity()
- : Entity( ItemEntityType::INSTANCE, 1 )
- {
- slot = new ItemSlot( INT_MAX, 0, 0, 0, ANY_DIRECTION, 0 );
- addSlot( slot );
- currentGame->setVisibility( this, 1 );
- // TODO: initialize model3d
- }
- bool ItemEntity::tick( double time )
- {
- lock();
- if( !model && slot->zStack() )
- {
- setModelDaten( slot->zStack()->zItem()->zItemType()->getItemModel() );
- textur = slot->zStack()->zItem()->zItemType()->getItemTextur();
- }
- unlock();
- return Entity::tick( time );
- }
- ItemEntityType::ItemEntityType()
- : EntityType( ID )
- {}
- Entity* ItemEntityType::createEntity() const
- {
- return new ItemEntity();
- }
|