@@ -1,6 +1,8 @@
#pragma once
-#include <Writer.h>
+#include <Reader.h>
+#include <ReferenceCounter.h>
+#include <Vec3.h>
#include "StaticRegistry.h"
@@ -2,9 +2,10 @@
#include <Punkt.h>
-#include "Block.h"
#include "Area.h"
+class Block;
+
class Chunk : public virtual Framework::ReferenceCounter
{
private:
@@ -11,7 +11,7 @@ private:
Network::SSLKlient *client;
bool connected;
void disconnect();
- NetworkReader *reader;
+ Network::NetworkReader *reader;
public:
FactoryClient();
@@ -1,5 +1,7 @@
+#include <Knopf.h>
#include "Menu.h"
class Game : public Menu
@@ -27,7 +27,7 @@ void Inventory::loadInventory( Framework::StreamReader *zReader )
int id = 0;
zReader->lese( (char *)&id, 4 );
Item *item = StaticRegistry<ItemType>::INSTANCE.zElement( id )->loadItem( zReader );
- iterator->addItems( new ItemStack( item, size ), NO_DIRECTION );
+ iterator->setItems( new ItemStack( item, size ) );
}
@@ -10,4 +10,15 @@ ItemSlot::ItemSlot( int maxSize, int pullPriority, int pushPriority, int allowed
pullPriority( pullPriority ),
pushPriority( pushPriority ),
allowHigherStackSize( allowHigherStackSize )
-{}
+{}
+ItemSlot::~ItemSlot()
+{
+ if( items )
+ items->release();
+}
+void ItemSlot::setItems( ItemStack *item )
+ this->items = items;
@@ -16,4 +16,7 @@ private:
ItemSlot( int maxSize, int pullPriority, int pushPriority, int allowedPullSide, int allowedPushSides, bool allowHigherStackSize );
+ ~ItemSlot();
+ void setItems( ItemStack *item );
};
@@ -13,6 +13,12 @@ ItemStack::ItemStack( Item *item, int currentSize )
: ItemStack( item, currentSize, item->getMaxStackSize() )
{}
+ItemStack::~ItemStack()
+ if( item )
+ item->release();
int ItemStack::getSize() const
return size;
@@ -12,6 +12,7 @@ private:
ItemStack( Item *item, int currentSize, int maxSize );
ItemStack( Item *item, int currentSize );
+ ~ItemStack();
int getSize() const;
int getMaxSize() const;
@@ -100,4 +100,5 @@ bool NetworkHandler::leaveGame()
fc->release();
fc = 0;
+ return 1;
+#include <Welt3D.h>
#include "Dimension.h"
#include "CurrentPlayer.h"
@@ -8,7 +10,7 @@ class World : public Framework::ReferenceCounter
Framework::RCArray<Dimension> *dimensions;
CurrentPlayer *currentPlayer;
- Welt3D *renderedWorld;
+ Framework::Welt3D *renderedWorld;
World();