Colobot
Public Types | Public Member Functions | List of all members
CSlottedObject Class Referenceabstract

Interface for objects that hold other objects. More...

#include <src/object/interface/slotted_object.h>

Inheritance diagram for CSlottedObject:
Inheritance graph
[legend]

Public Types

enum class  Pseudoslot { POWER , CARRYING }
 ! Object-independent identifiers for certain special slots More...
 

Public Member Functions

 CSlottedObject (ObjectInterfaceTypes &types)
 
virtual int MapPseudoSlot (Pseudoslot pseudoslot)=0
 Given one of the PSEUDOSLOT enums, returns real slot number, or -1 if specified pseudoslot is not present in this object. More...
 
virtual int GetNumSlots ()=0
 Get number of slots. Valid slot numbers are 0 up to GetNumSlots()-1. Using invalid slot numbers in the other functions will crash the game. More...
 
virtual Math::Vector GetSlotPosition (int slotNum)=0
 Get relative position of a slot. More...
 
virtual float GetSlotAngle (int slotNum)=0
 Get relative angle (in radians) where robot should be positioned when inserting into a slot. More...
 
virtual float GetSlotAcceptanceAngle (int slotNum)=0
 Get the maximum angular distance from the ideal angle (in radians) where robot should be positioned when inserting into a slot. More...
 
virtual CObjectGetSlotContainedObject (int slotNum)=0
 Get object contained in a slot. More...
 
virtual void SetSlotContainedObject (int slotNum, CObject *object)=0
 Set object contained in a slot. More...
 
void SetSlotContainedObjectReq (Pseudoslot pseudoslot, CObject *object)
 
CObjectGetSlotContainedObjectOpt (Pseudoslot pseudoslot)
 
CObjectGetSlotContainedObjectReq (Pseudoslot pseudoslot)
 

Detailed Description

Interface for objects that hold other objects.

Member Enumeration Documentation

◆ Pseudoslot

enum class CSlottedObject::Pseudoslot
strong

! Object-independent identifiers for certain special slots

Member Function Documentation

◆ MapPseudoSlot()

virtual int CSlottedObject::MapPseudoSlot ( Pseudoslot  pseudoslot)
pure virtual

Given one of the PSEUDOSLOT enums, returns real slot number, or -1 if specified pseudoslot is not present in this object.

Implemented in COldObject.

◆ GetNumSlots()

virtual int CSlottedObject::GetNumSlots ( )
pure virtual

Get number of slots. Valid slot numbers are 0 up to GetNumSlots()-1. Using invalid slot numbers in the other functions will crash the game.

Implemented in COldObject.

◆ GetSlotPosition()

virtual Math::Vector CSlottedObject::GetSlotPosition ( int  slotNum)
pure virtual

Get relative position of a slot.

Implemented in COldObject.

◆ GetSlotAngle()

virtual float CSlottedObject::GetSlotAngle ( int  slotNum)
pure virtual

Get relative angle (in radians) where robot should be positioned when inserting into a slot.

Implemented in COldObject.

◆ GetSlotAcceptanceAngle()

virtual float CSlottedObject::GetSlotAcceptanceAngle ( int  slotNum)
pure virtual

Get the maximum angular distance from the ideal angle (in radians) where robot should be positioned when inserting into a slot.

Implemented in COldObject.

◆ GetSlotContainedObject()

virtual CObject * CSlottedObject::GetSlotContainedObject ( int  slotNum)
pure virtual

Get object contained in a slot.

Implemented in COldObject.

◆ SetSlotContainedObject()

virtual void CSlottedObject::SetSlotContainedObject ( int  slotNum,
CObject object 
)
pure virtual

Set object contained in a slot.

Implemented in COldObject.


The documentation for this class was generated from the following file: