BVB Source Codes

CRYENGINE Show IItem.h Source code

Return Download CRYENGINE: download IItem.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. /*************************************************************************
  4.    -------------------------------------------------------------------------
  5.    $Id$
  6.    $DateTime$
  7.    Description: Item interface.
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 29:11:2005   13:52 : Created by M谩rcio Martins
  12.  
  13. *************************************************************************/
  14. #ifndef __IITEM_H__
  15. #define __IITEM_H__
  16.  
  17. #pragma once
  18.  
  19. #include <IGameObject.h>
  20.  
  21. enum EViewMode
  22. {
  23.         eIVM_Hidden      = 0,
  24.         eIVM_FirstPerson = 1,
  25.         eIVM_ThirdPerson = 2,
  26. };
  27.  
  28. struct IWeapon;
  29. struct IInventory;
  30.  
  31. // Summary
  32. //   Interface to implement a new Item class
  33. struct IItem : public IGameObjectExtension
  34. {
  35.         enum eItemBackAttachment
  36.         {
  37.                 eIBA_Primary = 0,
  38.                 eIBA_Secondary,
  39.                 eIBA_Unknown
  40.         };
  41.  
  42.         enum eItemHand
  43.         {
  44.                 eIH_Right = 0, // indicates the right hand of the actor
  45.                 eIH_Left,      // indicates the left hand of the actor
  46.                 eIH_Last,
  47.         };
  48.  
  49.         virtual const char* GetType() const = 0;
  50.  
  51.         // Summary
  52.         //   Retrieves the owner id
  53.         virtual EntityId GetOwnerId() const = 0;
  54.         virtual void     SetOwnerId(EntityId ownerId) = 0;
  55.  
  56.         virtual void     EnableUpdate(bool enable, int slot = -1) = 0;
  57.         virtual void     RequireUpdate(int slot) = 0;
  58.  
  59.         //-------------------- ACTIONS --------------------
  60.         virtual void ForcePendingActions(uint8 blockedActions = 0) = 0;
  61.  
  62.         //-------------------- EVENTS --------------------
  63.         virtual void OnAction(EntityId actorId, const ActionId& actionId, int activationMode, float value) = 0;
  64.         virtual void OnParentSelect(bool select) = 0;
  65.         virtual void OnAttach(bool attach) = 0;
  66.         virtual void OnPickedUp(EntityId actorId, bool destroyed) = 0;
  67.         virtual void OnHit(float damage, int hitType) = 0;
  68.  
  69.         //-------------------- HOLDING --------------------
  70.         virtual void         Select(bool select) = 0;
  71.         virtual bool         IsSelected() const = 0;
  72.         virtual bool         CanSelect() const = 0;
  73.         virtual bool         CanDeselect() const = 0;
  74.         virtual void         RemoveOwnerAttachedAccessories() = 0;
  75.  
  76.         virtual void         Physicalize(bool enable, bool rigid) = 0;
  77.         virtual bool         CanDrop() const = 0;
  78.         virtual void         Drop(float impulseScale = 1.0f, bool selectNext = true, bool byDeath = false) = 0;
  79.         virtual void         UpdateFPView(float frameTime) = 0;
  80.         virtual Vec3         GetMountedAngleLimits() const = 0;
  81.         virtual void         PickUp(EntityId picker, bool sound, bool select = true, bool keepHistory = true, const char* setup = NULL) = 0;
  82.         virtual void         MountAtEntity(EntityId entityId, const Vec3& pos, const Ang3& angles) = 0;
  83.         virtual bool         FilterView(struct SViewParams& viewParams) = 0;
  84.         virtual void         RemoveAllAccessories() = 0;
  85.         virtual void         DetachAllAccessories() = 0;
  86.         virtual void         AttachAccessory(IEntityClass* pClass, bool attach, bool noanim, bool force = false, bool firstTimeAttached = false, bool initialLoadoutSetup = false) = 0;
  87.         virtual void SetCurrentActionController(class IActionController* pActionController) = 0;
  88.         virtual void         UpdateCurrentActionController() = 0;
  89.         virtual const string GetAttachedAccessoriesString(const char* separator = ",") = 0;
  90.  
  91.         virtual void         SetHand(int hand) = 0;
  92.  
  93.         virtual void         StartUse(EntityId userId) = 0;
  94.         virtual void         StopUse(EntityId userId) = 0;
  95.         virtual void         SetBusy(bool busy) = 0;
  96.         virtual bool         IsBusy() const = 0;
  97.         virtual bool         CanUse(EntityId userId) const = 0;
  98.         virtual bool         IsUsed() const = 0;
  99.         virtual void         Use(EntityId userId) = 0;
  100.  
  101.         virtual bool         AttachToHand(bool attach, bool checkAttachment = false) = 0;
  102.         virtual bool         AttachToBack(bool attach) = 0;
  103.  
  104.         //-------------------- SETTINGS --------------------
  105.         virtual bool        IsModifying() const = 0;
  106.         virtual bool        CheckAmmoRestrictions(IInventory* pInventory) = 0;
  107.         virtual void        Reset() = 0;
  108.         virtual bool        ResetParams() = 0;
  109.         virtual void        PreResetParams() = 0;
  110.         virtual bool        GivesAmmo() = 0;
  111.         virtual const char* GetDisplayName() const = 0;
  112.         virtual void        HideItem(bool hide) = 0;
  113.  
  114.         virtual void        SetSubContextID(int tagContext) = 0;
  115.         virtual int         GetSubContextID() = 0;
  116.  
  117.         //-------------------- INTERFACES --------------------
  118.         virtual IWeapon*       GetIWeapon() = 0;
  119.         virtual const IWeapon* GetIWeapon() const = 0;
  120.  
  121.         // Summary
  122.         // Returns
  123.         //   true if the item is an accessory
  124.         virtual bool IsAccessory() = 0;
  125.  
  126.         //used to serialize item attachment when loading next level
  127.         virtual void SerializeLTL(TSerialize ser) = 0;
  128.  
  129.         // gets the original (not current) direction vector of a mounted weapon
  130.         virtual Vec3 GetMountedDir() const = 0;
  131. };
  132.  
  133. #endif // __IITEM_H__
  134.  
downloadIItem.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top