12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #pragma once
- #include <Array.h>
- #include "CraftingStorage.h"
- #include "Entity.h"
- #include "EntityType.h"
- class PlayerEntityType;
- class Player : public Entity,
- public BasicShapedCrafter
- {
- public:
- class Key
- {
- public:
- static const __int64 LEFT_HAND_ACTION = 0x100;
- static const __int64 RIGHT_HAND_ACTION = 0x200;
- };
- private:
- Framework::Text name;
- Framework::Array<ItemSlot*> itemBar;
- Framework::Array<ItemSlot*> crafting;
- int leftHandPosition;
- bool jumping;
- __int64 keyState;
- void useItemSlot(ItemSlot* zSlot, bool left);
- Player(Framework::Vec3<float> location, int dimensionId, int entityId);
- Framework::Text getInventoryUIML();
- Framework::Text getPlayerGUI();
- public:
- virtual void onTargetChange() override;
- void setName(Framework::Text name);
- const char* getName() const;
- void tick(const Dimension* zDimension) override;
- void playerApi(
- Framework::StreamReader* zRequest, NetworkMessage* zResponse);
- void onFall(float collisionSpeed) override;
- void onDeath() override;
- friend PlayerEntityType;
- };
- class PlayerEntityType : public EntityType
- {
- protected:
- virtual void loadSuperEntity(
- Entity* zEntity, Framework::StreamReader* zReader) const override;
- virtual void saveSuperEntity(
- Entity* zEntity, Framework::StreamWriter* zWriter) const override;
- public:
- PlayerEntityType();
- virtual Entity* createEntity(Framework::Vec3<float> position,
- int dimensionId,
- int entityId) const override;
- };
|