OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4ControlEMMoveObject Class Referenceabstract

#include <C4Control.h>

Inheritance diagram for C4ControlEMMoveObject:
[legend]
Collaboration diagram for C4ControlEMMoveObject:
[legend]

Public Member Functions

 C4ControlEMMoveObject ()
 
 C4ControlEMMoveObject (C4ControlEMObjectAction eAction, C4Real tx, C4Real ty, C4Object *pTargetObj, int32_t iObjectNum=0, int32_t *pObjects=nullptr, const char *szScript=nullptr, bool drag_finished=false)
 
 ~C4ControlEMMoveObject ()
 
int32_t getByClient () const
 
bool LocalControl () const
 
bool HostControl () const
 
void SetByClient (int32_t iByClient)
 
virtual bool PreExecute () const
 
virtual void Execute () const =0
 
virtual void PreRec (C4Record *pRecord)
 
virtual bool Lobby () const
 
virtual bool Sync () const
 
virtual void CompileFunc (StdCompiler *pComp)
 
C4NetIOPacket pack (const C4NetIO::addr_t &addr=C4NetIO::addr_t()) const
 
C4NetIOPacket pack (uint8_t cStatus, const C4NetIO::addr_t &addr=C4NetIO::addr_t()) const
 
void unpack (const C4NetIOPacket &Pkt, char *pStatus=nullptr)
 

Static Public Member Functions

static C4ControlEMMoveObjectCreateObject (const C4ID &id, C4Real x, C4Real y, C4Object *container)
 

Protected Attributes

C4ControlEMObjectAction eAction
 
C4Real tx
 
C4Real ty
 
int32_t iTargetObj
 
int32_t iObjectNum
 
int32_t * pObjects
 
StdStrBuf StringParam
 
bool drag_finished
 
int32_t iByClient
 

Detailed Description

Definition at line 460 of file C4Control.h.

Constructor & Destructor Documentation

C4ControlEMMoveObject::C4ControlEMMoveObject ( )
inline

Definition at line 463 of file C4Control.h.

Referenced by CreateObject().

463 : eAction(EMMO_Move), tx(Fix0), ty(Fix0), iTargetObj(0), iObjectNum(0), pObjects(nullptr), drag_finished(false) { }
C4ControlEMObjectAction eAction
Definition: C4Control.h:469
const C4Real Fix0
Definition: C4Real.h:312

Here is the caller graph for this function:

C4ControlEMMoveObject::C4ControlEMMoveObject ( C4ControlEMObjectAction  eAction,
C4Real  tx,
C4Real  ty,
C4Object pTargetObj,
int32_t  iObjectNum = 0,
int32_t *  pObjects = nullptr,
const char *  szScript = nullptr,
bool  drag_finished = false 
)

Definition at line 1218 of file C4Control.cpp.

1220  : eAction(eAction), tx(tx), ty(ty), iTargetObj(pTargetObj ? pTargetObj->Number : 0),
1222 {
1223 
1224 }
C4ControlEMObjectAction eAction
Definition: C4Control.h:469
StdStrBuf StringParam
Definition: C4Control.h:474
C4ControlEMMoveObject::~C4ControlEMMoveObject ( )

Definition at line 1236 of file C4Control.cpp.

References pObjects.

1237 {
1238  delete [] pObjects; pObjects = nullptr;
1239 }

Member Function Documentation

void C4ControlPacket::CompileFunc ( StdCompiler pComp)
virtualinherited

Implements C4PacketBase.

Definition at line 77 of file C4Control.cpp.

References C4ControlPacket::iByClient, mkIntPackAdapt(), mkNamingAdapt(), and StdCompiler::Value().

78 {
79  // Section must be set by caller
80  pComp->Value(mkNamingAdapt(mkIntPackAdapt(iByClient), "ByClient", -1));
81 }
int32_t iByClient
Definition: C4Control.h:39
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:93
void Value(const T &rStruct)
Definition: StdCompiler.h:171
StdIntPackAdapt< T > mkIntPackAdapt(T &rVal)
Definition: StdAdaptors.h:757

Here is the call graph for this function:

C4ControlEMMoveObject * C4ControlEMMoveObject::CreateObject ( const C4ID id,
C4Real  x,
C4Real  y,
C4Object container 
)
static

Definition at line 1226 of file C4Control.cpp.

References C4ControlEMMoveObject(), EMMO_Create, and StartSoundEffect().

Referenced by C4EditCursor::ApplyCreateObject(), and C4Game::DropDef().

1227 {
1228 #ifdef WITH_QT_EDITOR
1229  ::StartSoundEffect("UI::Click2");
1230 #endif
1231  auto ctl = new C4ControlEMMoveObject(EMMO_Create, x, y, container);
1232  ctl->StringParam = id.ToString();
1233  return ctl;
1234 }
C4SoundInstance * StartSoundEffect(const char *szSndName, bool fLoop, int32_t iVolume, C4Object *pObj, int32_t iCustomFalloffDistance, int32_t iPitch, C4SoundModifier *modifier)

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void C4ControlPacket::Execute ( ) const
pure virtualinherited

Referenced by C4GameControl::DoSyncCheck(), C4GameControl::ExecControlPacket(), and C4Control::Execute().

Here is the caller graph for this function:

int32_t C4ControlPacket::getByClient ( ) const
inlineinherited

Definition at line 42 of file C4Control.h.

References C4ControlPacket::iByClient.

Referenced by C4Network2::GetVote(), and C4Network2::OpenVoteDialog().

42 { return iByClient; }
int32_t iByClient
Definition: C4Control.h:39

Here is the caller graph for this function:

bool C4ControlPacket::HostControl ( ) const
inlineinherited

Definition at line 44 of file C4Control.h.

References C4ClientIDHost.

44 { return iByClient == C4ClientIDHost; }
int32_t iByClient
Definition: C4Control.h:39
const int32_t C4ClientIDHost
Definition: C4Client.h:25
virtual bool C4ControlPacket::Lobby ( ) const
inlinevirtualinherited

Reimplemented in C4ControlMessage, C4ControlPlayerInfo, C4ControlClientRemove, C4ControlClientUpdate, C4ControlClientJoin, and C4ControlSet.

Definition at line 53 of file C4Control.h.

Referenced by C4GameControl::DoInput().

53 { return false; }

Here is the caller graph for this function:

bool C4ControlPacket::LocalControl ( ) const
inherited

Definition at line 67 of file C4Control.cpp.

References C4GameControl::ClientID(), Control, and C4ControlPacket::iByClient.

68 {
69  return iByClient == ::Control.ClientID();
70 }
int32_t iByClient
Definition: C4Control.h:39
C4GameControl Control
int32_t ClientID() const

Here is the call graph for this function:

C4NetIOPacket C4PacketBase::pack ( const C4NetIO::addr_t addr = C4NetIO::addr_t()) const
inherited

Definition at line 156 of file C4Packet2.cpp.

Referenced by MkC4NetIOPacket().

157 {
158  return C4NetIOPacket(DecompileToBuf<StdCompilerBinWrite>(*this), addr);
159 }

Here is the caller graph for this function:

C4NetIOPacket C4PacketBase::pack ( uint8_t  cStatus,
const C4NetIO::addr_t addr = C4NetIO::addr_t() 
) const
inherited

Definition at line 161 of file C4Packet2.cpp.

References mkDecompileAdapt(), and mkInsertAdapt().

162 {
163  return C4NetIOPacket(DecompileToBuf<StdCompilerBinWrite>(mkInsertAdapt(mkDecompileAdapt(*this), cStatus)), addr);
164 }
StdDecompileAdapt< T > mkDecompileAdapt(const T &rValue)
Definition: StdAdaptors.h:154
StdInsertAdapt< T, I > mkInsertAdapt(T &&rObj, I &&rIns, bool fBefore=true)
Definition: StdAdaptors.h:435

Here is the call graph for this function:

virtual bool C4ControlPacket::PreExecute ( ) const
inlinevirtualinherited

Reimplemented in C4ControlJoinPlayer.

Definition at line 48 of file C4Control.h.

Referenced by C4GameControl::ExecControlPacket(), and C4Control::PreExecute().

48 { return true; }

Here is the caller graph for this function:

virtual void C4ControlPacket::PreRec ( C4Record pRecord)
inlinevirtualinherited

Reimplemented in C4ControlJoinPlayer.

Definition at line 50 of file C4Control.h.

Referenced by C4Control::PreRec(), and C4Record::Rec().

50 { }

Here is the caller graph for this function:

void C4ControlPacket::SetByClient ( int32_t  iByClient)
inherited

Definition at line 72 of file C4Control.cpp.

References C4ControlPacket::iByClient.

73 {
74  iByClient = inByClient;
75 }
int32_t iByClient
Definition: C4Control.h:39
virtual bool C4ControlPacket::Sync ( ) const
inlinevirtualinherited

Reimplemented in C4ControlVoteEnd, C4ControlVote, C4ControlMessage, C4ControlPlayerInfo, C4ControlClientRemove, C4ControlClientUpdate, C4ControlClientJoin, and C4ControlSyncCheck.

Definition at line 55 of file C4Control.h.

Referenced by C4Playback::Check(), and C4GameControl::DoInput().

55 { return true; }

Here is the caller graph for this function:

void C4PacketBase::unpack ( const C4NetIOPacket Pkt,
char *  pStatus = nullptr 
)
inherited

Definition at line 166 of file C4Packet2.cpp.

References C4NetIOPacket::getPBuf(), C4NetIOPacket::getRef(), and C4NetIOPacket::getStatus().

Referenced by C4IDPacket::C4IDPacket(), and C4Network2IO::HandlePacket().

167 {
168  if (pStatus) *pStatus = Pkt.getStatus();
169  CompileFromBuf<StdCompilerBinRead>(*this, pStatus ? Pkt.getPBuf() : Pkt.getRef());
170 }
StdBuf getPBuf() const
Definition: C4NetIO.h:321
C4NetIOPacket getRef() const
Definition: C4NetIO.h:324
uint8_t getStatus() const
Definition: C4NetIO.h:318

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

bool C4ControlEMMoveObject::drag_finished
protected

Definition at line 475 of file C4Control.h.

C4ControlEMObjectAction C4ControlEMMoveObject::eAction
protected

Definition at line 469 of file C4Control.h.

int32_t C4ControlPacket::iByClient
protectedinherited
int32_t C4ControlEMMoveObject::iObjectNum
protected

Definition at line 472 of file C4Control.h.

int32_t C4ControlEMMoveObject::iTargetObj
protected

Definition at line 471 of file C4Control.h.

int32_t* C4ControlEMMoveObject::pObjects
protected

Definition at line 473 of file C4Control.h.

Referenced by ~C4ControlEMMoveObject().

StdStrBuf C4ControlEMMoveObject::StringParam
protected

Definition at line 474 of file C4Control.h.

C4Real C4ControlEMMoveObject::tx
protected

Definition at line 470 of file C4Control.h.

C4Real C4ControlEMMoveObject::ty
protected

Definition at line 470 of file C4Control.h.


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