OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4Def Class Reference

#include <C4Def.h>

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

Public Member Functions

void DefaultDefCore ()
 
bool LoadDefCore (C4Group &hGroup)
 
bool Save (C4Group &hGroup)
 
void CompileFunc (StdCompiler *pComp)
 
 C4Def ()
 
 ~C4Def ()
 
void Clear ()
 
void Default ()
 
bool Load (C4Group &hGroup, StdMeshSkeletonLoader &loader, DWORD dwLoadWhat, const char *szLanguage, class C4SoundSystem *pSoundSystem=nullptr, C4DefGraphicsPtrBackup *gfx_backup=nullptr)
 
void Draw (C4Facet &cgo, bool fSelected=false, DWORD iColor=0, C4Object *pObj=nullptr, int32_t iPhaseX=0, int32_t iPhaseY=0, C4DrawTransform *trans=nullptr, const char *graphicsName=nullptr)
 
C4FacetGetMainFace (C4DefGraphics *pGraphics, DWORD dwClr=0)
 
int32_t GetPlane ()
 
int32_t GetValue (C4Object *pInBase, int32_t iBuyPlayer)
 
void Synchronize ()
 
virtual C4Def const * GetDef () const
 
virtual C4DefGetDef ()
 
virtual bool Delete ()
 
void IncludeDefinition (C4Def *pIncludeDef)
 
void ResetIncludeDependencies ()
 
C4PropListGetActionByName (const char *actname)
 
C4PropListGetActionByName (C4String *actname)
 
virtual C4PropListStaticIsStatic ()
 
const class C4PropListStaticIsStatic () const
 
void RefCompileFunc (StdCompiler *pComp, C4ValueNumbers *numbers) const
 
StdStrBuf GetDataString () const
 
virtual const char * GetName () const
 
const C4PropListStaticGetParent () const
 
C4StringGetParentKeyName ()
 
virtual void SetName (const char *NewName=0)
 
virtual void SetOnFire (bool OnFire)
 
virtual C4ObjectGetObject ()
 
virtual C4Object const * GetObject () const
 
virtual C4EffectGetEffect ()
 
virtual C4PropListNumberedGetPropListNumbered ()
 
virtual class C4MapScriptLayerGetMapScriptLayer ()
 
virtual class C4MapScriptMapGetMapScriptMap ()
 
C4PropListGetPrototype () const
 
void RemoveCyclicPrototypes ()
 
virtual bool IsNumbered () const
 
virtual bool GetPropertyByS (const C4String *k, C4Value *pResult) const
 
virtual C4ValueArrayGetProperties () const
 
virtual void SetPropertyByS (C4String *k, const C4Value &to)
 
virtual void ResetProperty (C4String *k)
 
bool GetProperty (C4PropertyName k, C4Value *pResult) const
 
C4StringGetPropertyStr (C4PropertyName k) const
 
C4ValueArrayGetPropertyArray (C4PropertyName n) const
 
C4AulFuncGetFunc (C4PropertyName k) const
 
C4AulFuncGetFunc (C4String *k) const
 
C4AulFuncGetFunc (const char *k) const
 
C4StringEnumerateOwnFuncs (C4String *prev=0) const
 
C4Value Call (C4PropertyName k, C4AulParSet *pPars=0, bool fPassErrors=false)
 
C4Value Call (C4String *k, C4AulParSet *pPars=0, bool fPassErrors=false)
 
C4Value Call (const char *k, C4AulParSet *pPars=0, bool fPassErrors=false)
 
C4PropertyName GetPropertyP (C4PropertyName k) const
 
int32_t GetPropertyBool (C4PropertyName n, bool default_val=false) const
 
int32_t GetPropertyInt (C4PropertyName k, int32_t default_val=0) const
 
C4PropListGetPropertyPropList (C4PropertyName k) const
 
bool HasProperty (C4String *k) const
 
void SetProperty (C4PropertyName k, const C4Value &to)
 
void Freeze ()
 
void Thaw ()
 
bool IsFrozen () const
 
C4PropListStaticFreezeAndMakeStaticRecursively (std::vector< C4Value > *prop_lists, const C4PropListStatic *parent=nullptr, C4String *key=nullptr)
 
virtual void Denumerate (C4ValueNumbers *)
 
void CompileFunc (StdCompiler *pComp, C4ValueNumbers *)
 
void AppendDataString (StdStrBuf *out, const char *delim, int depth=3, bool ignore_reference_parent=false) const
 
StdStrBuf ToJSON (int depth=10, bool ignore_reference_parent=false) const
 
std::vector< C4String * > GetSortedLocalProperties (bool add_prototype=true) const
 
std::vector< C4String * > GetSortedLocalProperties (const char *prefix, const C4PropList *ignore_overridden) const
 
std::vector< C4String * > GetUnsortedProperties (const char *prefix, C4PropList *ignore_parent=nullptr) const
 
std::vector< C4String * > GetSortedProperties (const char *prefix, C4PropList *ignore_parent=nullptr) const
 
bool operator== (const C4PropList &b) const
 
Iterator begin ()
 
Iterator end ()
 

Static Public Member Functions

static C4PropListNew (C4PropList *prototype=0)
 
static C4PropListStaticNewStatic (C4PropList *prototype, const C4PropListStatic *parent, C4String *key)
 

Public Attributes

C4ID id
 
int32_t rC4XVer [2]
 
C4IDList RequireDef
 
C4Shape Shape
 
C4Rect Entrance
 
C4Rect Collection
 
C4Rect PictureRect
 
C4TargetRect SolidMask
 
C4TargetRect TopFace
 
C4ID BurnTurnTo
 
int32_t GrowthType
 
int32_t CrewMember
 
int32_t NativeCrew
 
int32_t Mass
 
int32_t Value
 
int32_t Exclusive
 
int32_t Category
 
int32_t Constructable
 
int32_t Rotateable
 
int32_t Float
 
int32_t ColorByOwner
 
int32_t NoHorizontalMove
 
int32_t LiftTop
 
int32_t GrabPutGet
 
int32_t UprightAttach
 
int32_t Line
 
int32_t LineIntersect
 
int32_t IncompleteActivity
 
int32_t AttractLightning
 
int32_t Oversize
 
int32_t Fragile
 
int32_t Projectile
 
int32_t NoPushEnter
 
int32_t VehicleControl
 
int32_t Pathfinder
 
int32_t MoveToRange
 
int32_t NoMassFromContents
 
int32_t NoStabilize
 
int32_t ClosedContainer
 
int32_t SilentCommands
 
int32_t TemporaryCrew
 
int32_t BlitMode
 
int32_t NoBreath
 
int32_t ConSizeOff
 
int32_t NoGet
 
int32_t RotatedEntrance
 
int32_t NoTransferZones
 
int32_t AllowPictureStack
 
bool HideInCreator
 
char Filename [_MAX_FNAME+1]
 
StdCopyStrBuf ConsoleGroupPath
 
int32_t Creation
 
int32_t Count
 
C4DefScriptHost Script
 
C4LangStringTable StringTable
 
C4ComponentHostpClonkNames
 
bool fClonkNamesOwned
 
C4RankSystempRankNames
 
bool fRankNamesOwned
 
C4FacetSurfacepRankSymbols
 
bool fRankSymbolsOwned
 
int32_t iNumRankSymbols
 
C4DefGraphics Graphics
 
CSurface8pSolidMask
 
int32_t Status
 

Protected Member Functions

bool Compile (const char *szSource, const char *szName)
 
bool Decompile (StdStrBuf *pOut, const char *szName)
 
bool LoadActMap (C4Group &hGroup)
 
void CrossMapActMap ()
 
void ClearRefs ()
 

Protected Attributes

C4Facet MainFace
 
C4DefNext
 
bool Temporary
 
const C4PropListStaticParent
 
C4RefCntPointer< C4StringParentKeyName
 

Friends

class C4DefList
 

Detailed Description

Definition at line 100 of file C4Def.h.

Constructor & Destructor Documentation

C4Def::C4Def ( )

Definition at line 26 of file c4def-handle.cpp.

References C4ScriptHost::Clear(), C4AulScriptEngine::GetPropList(), Graphics, Next, C4DefGraphics::pDef, Script, ScriptEngine, and C4DefScriptHost::SetDef().

26  : Script(), C4PropListStatic(ScriptEngine.GetPropList(), nullptr, nullptr)
27 {
28  Script.SetDef(this);
29  assert(ScriptEngine.GetPropList());
30  Graphics.pDef = this;
31 
32  Next = nullptr;
33  Script.Clear();
34 }
C4PropListStatic * GetPropList()
Definition: C4Aul.h:153
C4AulScriptEngine ScriptEngine
Definition: C4Globals.cpp:43
C4PropListStatic(C4PropList *prototype, const C4PropListStatic *parent, C4String *key)
Definition: C4PropList.h:263
C4Def * Next
Definition: C4Def.h:201
void SetDef(C4Def *to_def)
Definition: C4ScriptHost.h:143
C4DefScriptHost Script
Definition: C4Def.h:184
C4DefGraphics Graphics
Definition: C4Def.h:194

Here is the call graph for this function:

C4Def::~C4Def ( )

Definition at line 36 of file c4def-handle.cpp.

References C4ScriptHost::Clear(), C4PropList::Clear(), and Script.

37 {
39  Script.Clear();
40 }
void Clear()
Definition: C4PropList.h:68
C4DefScriptHost Script
Definition: C4Def.h:184

Here is the call graph for this function:

Member Function Documentation

void C4PropList::AppendDataString ( StdStrBuf out,
const char *  delim,
int  depth = 3,
bool  ignore_reference_parent = false 
) const
inherited

Definition at line 497 of file C4PropList.cpp.

References StdStrBuf::Append(), C4Set< T >::GetSize(), C4Set< T >::GetSortedListOfElementPointers(), and C4PropList::IsStatic().

Referenced by C4Value::GetDataString(), and C4Object::GetDataString().

498 {
499  StdStrBuf & DataString = *out;
500  if (depth <= 0 && Properties.GetSize())
501  {
502  DataString.Append("...");
503  return;
504  }
505  std::list<const C4Property *> sorted_props = Properties.GetSortedListOfElementPointers();
506  for (std::list<const C4Property *>::const_iterator p = sorted_props.begin(); p != sorted_props.end(); ++p)
507  {
508  if (p != sorted_props.begin()) DataString.Append(delim);
509  DataString.Append((*p)->Key->GetData());
510  DataString.Append(" = ");
511  DataString.Append((*p)->Value.GetDataString(depth - 1, ignore_reference_parent ? IsStatic() : nullptr));
512  }
513 }
std::list< const T * > GetSortedListOfElementPointers() const
virtual class C4PropListStatic * IsStatic()
Definition: C4PropList.h:87
unsigned int GetSize() const
void Append(const char *pnData, size_t iChars)
Definition: StdBuf.h:527

Here is the call graph for this function:

Here is the caller graph for this function:

C4PropList::Iterator C4PropList::begin ( )
inherited

Definition at line 962 of file C4PropList.cpp.

References C4PropList::begin(), C4Set< T >::First(), C4PropList::GetPrototype(), C4Set< T >::GetSize(), and C4Set< T >::Next().

Referenced by C4PropList::begin(), and C4ParticleProperties::Set().

963 {
965 
966  if (GetPrototype())
967  {
968  iter = GetPrototype()->begin();
969  }
970  else
971  {
972  iter.properties = std::make_shared<std::vector<const C4Property*> >();
973  }
974  iter.Reserve(Properties.GetSize());
975 
976  const C4Property * p = Properties.First();
977  while (p)
978  {
979  iter.AddProperty(p);
980  p = Properties.Next(p);
981  }
982 
983  iter.Init();
984  return iter;
985 }
T const * Next(T const *p) const
unsigned int GetSize() const
Iterator begin()
Definition: C4PropList.cpp:962
C4PropList * GetPrototype() const
Definition: C4PropList.h:83
T const * First() const

Here is the call graph for this function:

Here is the caller graph for this function:

C4Value C4PropList::Call ( C4PropertyName  k,
C4AulParSet pPars = 0,
bool  fPassErrors = false 
)
inlineinherited

Definition at line 112 of file C4PropList.h.

References C4StringTable::P, and Strings.

Referenced by C4Command::Acquire(), C4Object::ActivateEntrance(), C4Object::ActivateMenu(), C4Object::AssignDeath(), C4Object::AssignRemoval(), C4Command::Call(), C4GameScriptHost::Call(), C4Effect::CallEffect(), C4Command::CallFailed(), C4Effect::CallStart(), C4Effect::CallStop(), C4Effect::CallTimer(), C4FindObjectFunc::Check(), C4Effect::ClearAll(), C4Object::Collect(), C4SortObjectFunc::CompareGetValue(), C4Object::Contact(), C4GameObjects::CrossCheck(), C4Landscape::P::DigMaterial2Objects(), C4Object::DirectComContents(), C4Object::DoBreath(), C4Object::DoCon(), C4Object::DoDamage(), C4Object::DoEnergy(), C4Object::DoMovement(), C4ObjectMenu::DoRefillInternal(), C4Object::DoSelect(), C4Object::Enter(), C4RoundResults::EvaluateGame(), C4RoundResults::EvaluateGoals(), C4Object::ExecAction(), C4Object::ExecLife(), C4ScriptGuiWindowAction::ExecuteCommand(), C4Object::ExecuteCommand(), C4Object::Exit(), C4Command::Fail(), C4Command::GetTryEnter(), GetValue(), C4Object::GetValue(), GrabLost(), C4GameObjects::GRBroadcast(), C4Landscape::Incinerate(), C4Effect::Init(), C4Player::Init(), C4Game::InitGame(), C4ObjectMenu::IsCloseDenied(), C4Effect::Kill(), C4Object::Lift(), C4Player::MakeCrewMember(), C4Game::NewObject(), ObjectActionJump(), ObjectComGrab(), ObjectComPunch(), ObjectComPut(), ObjectComUnGrab(), C4ObjectMenu::OnSelectionChanged(), C4GameObjects::OnSynchronized(), C4EditCursor::PerformDuplication(), C4EditCursor::PerformDuplicationLegacy(), C4Player::PlaceReadyCrew(), C4Landscape::P::PostFreeShape(), C4Object::Promote(), C4Object::Push(), C4Game::SaveData(), C4Object::SetAction(), C4GUI::FrameDecoration::SetByDef(), C4Object::SetCommand(), C4Player::SetObjectCrewStatus(), C4Object::SetOwner(), C4Object::StatusActivate(), C4Command::Transfer(), and C4Object::UnSelect().

113  { return Call(&Strings.P[k], pPars, fPassErrors); }
C4String P[P_LAST]
C4StringTable Strings
Definition: C4Globals.cpp:42
C4Value Call(C4PropertyName k, C4AulParSet *pPars=0, bool fPassErrors=false)
Definition: C4PropList.h:112

Here is the caller graph for this function:

C4Value C4PropList::Call ( C4String k,
C4AulParSet pPars = 0,
bool  fPassErrors = false 
)
inherited

Definition at line 783 of file C4PropList.cpp.

References C4PropList::C4Value, C4AulFunc::Exec(), C4PropList::GetFunc(), and C4PropList::Status.

784 {
785  if (!Status) return C4Value();
786  C4AulFunc *pFn = GetFunc(k);
787  if (!pFn) return C4Value();
788  return pFn->Exec(this, Pars, fPassErrors);
789 }
C4AulFunc * GetFunc(C4PropertyName k) const
Definition: C4PropList.h:107
friend class C4Value
Definition: C4PropList.h:166
C4Value Exec(C4PropList *p=nullptr, C4AulParSet *pPars=nullptr, bool fPassErrors=false)
Definition: C4AulFunc.h:73
int32_t Status
Definition: C4PropList.h:169

Here is the call graph for this function:

C4Value C4PropList::Call ( const char *  k,
C4AulParSet pPars = 0,
bool  fPassErrors = false 
)
inherited

Definition at line 791 of file C4PropList.cpp.

References C4PropList::C4Value, C4AulFunc::Exec(), FormatString(), C4AulScriptEngine::GetErrorHandler(), C4PropList::GetFunc(), C4AulErrorHandler::OnError(), ScriptEngine, C4PropList::Status, and C4AulError::what().

792 {
793  if (!Status) return C4Value();
794  assert(s && s[0]);
795  C4AulFunc *pFn = GetFunc(s);
796  if (!pFn)
797  {
798  if (s[0] != '~')
799  {
800  C4AulExecError err(FormatString("Undefined function: %s", s).getData());
801  if (fPassErrors)
802  throw err;
803  ::ScriptEngine.GetErrorHandler()->OnError(err.what());
804  }
805  return C4Value();
806  }
807  return pFn->Exec(this, Pars, fPassErrors);
808 }
C4AulErrorHandler * GetErrorHandler() const
Definition: C4Aul.h:175
C4AulScriptEngine ScriptEngine
Definition: C4Globals.cpp:43
C4AulFunc * GetFunc(C4PropertyName k) const
Definition: C4PropList.h:107
friend class C4Value
Definition: C4PropList.h:166
C4Value Exec(C4PropList *p=nullptr, C4AulParSet *pPars=nullptr, bool fPassErrors=false)
Definition: C4AulFunc.h:73
int32_t Status
Definition: C4PropList.h:169
virtual void OnError(const char *msg)=0
#define s
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:277

Here is the call graph for this function:

void C4Def::Clear ( )

Definition at line 326 of file C4Def.cpp.

References C4ComponentHost::Clear(), C4ScriptHost::Clear(), C4PropList::Clear(), C4DefGraphics::Clear(), fClonkNamesOwned, fRankNamesOwned, fRankSymbolsOwned, Graphics, pClonkNames, pRankNames, pRankSymbols, pSolidMask, Script, and StringTable.

Referenced by C4DefList::Reload().

327 {
328  Script.Clear();
330 
331  Graphics.Clear();
332 
333  StringTable.Clear();
334  if (pClonkNames && fClonkNamesOwned) delete pClonkNames; pClonkNames=nullptr;
335  if (pRankNames && fRankNamesOwned) delete pRankNames; pRankNames=nullptr;
338  delete pSolidMask; pSolidMask = nullptr;
339 }
CSurface8 * pSolidMask
Definition: C4Def.h:195
C4ComponentHost * pClonkNames
Definition: C4Def.h:188
bool fRankSymbolsOwned
Definition: C4Def.h:192
bool fRankNamesOwned
Definition: C4Def.h:191
void Clear()
Definition: C4PropList.h:68
C4FacetSurface * pRankSymbols
Definition: C4Def.h:192
C4LangStringTable StringTable
Definition: C4Def.h:185
C4DefScriptHost Script
Definition: C4Def.h:184
C4RankSystem * pRankNames
Definition: C4Def.h:191
C4DefGraphics Graphics
Definition: C4Def.h:194
bool fClonkNamesOwned
Definition: C4Def.h:188

Here is the call graph for this function:

Here is the caller graph for this function:

void C4PropList::ClearRefs ( )
inlineprotectedinherited

Definition at line 157 of file C4PropList.h.

References C4Value::Set0().

Referenced by C4Object::AssignRemoval().

157 { while (FirstRef) FirstRef->Set0(); }
void Set0()
Definition: C4Value.h:336

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4Def::Compile ( const char *  szSource,
const char *  szName 
)
protected

Definition at line 174 of file C4Def.cpp.

References mkNamingAdapt().

Referenced by LoadDefCore().

175 {
176  return CompileFromBuf_LogWarn<StdCompilerINIRead>(mkNamingAdapt(*this, "DefCore"), StdStrBuf(szSource), szName);
177 }
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:93

Here is the call graph for this function:

Here is the caller graph for this function:

void C4PropList::CompileFunc ( StdCompiler pComp,
C4ValueNumbers numbers 
)
inherited

Definition at line 376 of file C4PropList.cpp.

References C4Set< T >::Get(), C4Set< T >::Has(), StdCompiler::hasNaming(), StdCompiler::isDeserializer(), mkParAdapt(), C4StringTable::P, P_Prototype, C4Set< T >::Remove(), StdCompiler::SEP_SEP2, StdCompiler::Separator(), Strings, C4Property::Value, and StdCompiler::Value().

Referenced by C4PropListNumbered::CompileFunc().

377 {
378  bool oldFormat = false;
379  // constant proplists are not serialized to savegames, but recreated from the game data instead
380  assert(!constant);
381  if (pComp->isDeserializer() && pComp->hasNaming())
382  {
383  // backwards compat to savegames and scenarios before 5.5
384  try
385  {
386  pComp->Value(constant);
387  oldFormat = true;
388  }
389  catch (StdCompiler::NotFoundException *pEx)
390  {
391  delete pEx;
392  pComp->Value(mkParAdapt(prototype, numbers));
393  }
394  }
395  else
396  pComp->Value(mkParAdapt(prototype, numbers));
398  pComp->Value(mkParAdapt(Properties, numbers));
399  if (oldFormat)
400  {
401  if (Properties.Has(&::Strings.P[P_Prototype]))
402  {
403  prototype = Properties.Get(&::Strings.P[P_Prototype]).Value;
404  Properties.Remove(&::Strings.P[P_Prototype]);
405  }
406  }
407 }
C4String P[P_LAST]
virtual bool Separator(Sep eSep=SEP_SEP)
Definition: StdCompiler.h:129
C4Value Value
Definition: C4PropList.h:57
virtual bool hasNaming()
Definition: StdCompiler.h:68
bool Has(H e) const
T & Get(H e) const
C4StringTable Strings
Definition: C4Globals.cpp:42
void Value(const T &rStruct)
Definition: StdCompiler.h:170
void Remove(H e)
virtual bool isDeserializer()
Definition: StdCompiler.h:63
StdParameterAdapt< T, P > mkParAdapt(T &&rObj, P &&rPar)
Definition: StdAdaptors.h:456

Here is the call graph for this function:

Here is the caller graph for this function:

void C4Def::CompileFunc ( StdCompiler pComp)

Definition at line 184 of file C4Def.cpp.

References AllowPictureStack, APS_Color, APS_Graphics, APS_Name, APS_Overlay, AttractLightning, BlitMode, C4D_Background, C4D_Blit_Normal, C4D_Environment, C4D_Foreground, C4D_Goal, C4D_Grab_Get, C4D_Grab_Put, C4D_IgnoreFoW, C4D_Living, C4D_MouseIgnore, C4D_MouseSelect, C4D_None, C4D_Object, C4D_Parallax, C4D_Rule, C4D_StaticBack, C4D_Structure, C4D_Vehicle, Category, ClosedContainer, Collection, ColorByOwner, ConSizeOff, Constructable, CrewMember, Entrance, Exclusive, Float, Fragile, GrabPutGet, GrowthType, HideInCreator, IncompleteActivity, LiftTop, Line, LineIntersect, Mass, mkBitfieldAdapt(), mkNamingAdapt(), mkParAdapt(), MoveToRange, NativeCrew, NoBreath, NoGet, NoHorizontalMove, NoMassFromContents, C4ID::None, NoPushEnter, NoStabilize, NoTransferZones, Oversize, Pathfinder, PictureRect, Projectile, rC4XVer, Rect0(), RequireDef, Rotateable, RotatedEntrance, Shape, SilentCommands, SolidMask, TargetRect0(), TemporaryCrew, toC4CArr, TopFace, UprightAttach, Value, StdCompiler::Value(), and VehicleControl.

185 {
186 
187  pComp->Value(mkNamingAdapt(id, "id", C4ID::None ));
188  pComp->Value(mkNamingAdapt(toC4CArr(rC4XVer), "Version" ));
189  pComp->Value(mkNamingAdapt(mkParAdapt(RequireDef, false), "RequireDef", C4IDList() ));
190 
191  const StdBitfieldEntry<int32_t> Categories[] =
192  {
193 
194  { "C4D_None", C4D_None },
195  { "C4D_StaticBack", C4D_StaticBack },
196  { "C4D_Structure", C4D_Structure },
197  { "C4D_Vehicle", C4D_Vehicle },
198  { "C4D_Living", C4D_Living },
199  { "C4D_Object", C4D_Object },
200 
201  { "C4D_Goal", C4D_Goal },
202  { "C4D_Rule", C4D_Rule },
203  { "C4D_Environment", C4D_Environment },
204 
205  { "C4D_Background", C4D_Background },
206  { "C4D_Parallax", C4D_Parallax },
207  { "C4D_MouseSelect", C4D_MouseSelect },
208  { "C4D_Foreground", C4D_Foreground },
209  { "C4D_MouseIgnore", C4D_MouseIgnore },
210  { "C4D_IgnoreFoW", C4D_IgnoreFoW },
211 
212  { nullptr, 0 }
213  };
214 
215  pComp->Value(mkNamingAdapt(mkBitfieldAdapt<int32_t>(Category, Categories),
216  "Category", 0 ));
217 
218  pComp->Value(mkParAdapt(Shape, static_cast<C4Shape*>(nullptr)));
219  pComp->Value(mkNamingAdapt(Value, "Value", 0 ));
220  pComp->Value(mkNamingAdapt(Mass, "Mass", 0 ));
221  pComp->Value(mkNamingAdapt(SolidMask, "SolidMask", TargetRect0 ));
222  pComp->Value(mkNamingAdapt(TopFace, "TopFace", TargetRect0 ));
223  pComp->Value(mkNamingAdapt(PictureRect, "Picture", Rect0 ));
224  pComp->Value(mkNamingAdapt(Entrance, "Entrance", Rect0 ));
225  pComp->Value(mkNamingAdapt(Collection, "Collection", Rect0 ));
226  pComp->Value(mkNamingAdapt(Exclusive, "Exclusive", 0 ));
227  pComp->Value(mkNamingAdapt(Line, "Line", 0 ));
228  // <Newton> undocumented, but obsolete? I don't understand the sense of this value.
229  pComp->Value(mkNamingAdapt(LineIntersect, "LineIntersect", 0 ));
230  pComp->Value(mkNamingAdapt(CrewMember, "CrewMember", 0 ));
231  pComp->Value(mkNamingAdapt(NativeCrew, "NoStandardCrew", 0 ));
232  pComp->Value(mkNamingAdapt(Constructable, "Construction", 0 ));
233 
234  const StdBitfieldEntry<int32_t> GrabPutGetTypes[] =
235  {
236 
237  { "C4D_GrabGet" ,C4D_Grab_Get},
238  { "C4D_GrabPut" ,C4D_Grab_Put},
239 
240  { nullptr, 0}
241  };
242 
243  pComp->Value(mkNamingAdapt(mkBitfieldAdapt(GrabPutGet, GrabPutGetTypes),
244  "GrabPutGet", 0 ));
245 
246  pComp->Value(mkNamingAdapt(Rotateable, "Rotate", 0 ));
247  pComp->Value(mkNamingAdapt(RotatedEntrance, "RotatedEntrance", 0 ));
248  pComp->Value(mkNamingAdapt(Float, "Float", 0 ));
249  pComp->Value(mkNamingAdapt(ColorByOwner, "ColorByOwner", 0 ));
250  pComp->Value(mkNamingAdapt(NoHorizontalMove, "HorizontalFix", 0 ));
251  pComp->Value(mkNamingAdapt(LiftTop, "LiftTop", 0 ));
252  pComp->Value(mkNamingAdapt(UprightAttach, "UprightAttach", 0 ));
253  pComp->Value(mkNamingAdapt(GrowthType, "StretchGrowth", 0 ));
254  pComp->Value(mkNamingAdapt(IncompleteActivity, "IncompleteActivity", 0 ));
255  pComp->Value(mkNamingAdapt(AttractLightning, "AttractLightning", 0 ));
256  pComp->Value(mkNamingAdapt(Oversize, "Oversize", 0 ));
257  // <Newton> Fragile and Projectile are kinda obsolete.
258  // Only used at one point in the command system. Should rather be solved with properties if at all
259  pComp->Value(mkNamingAdapt(Fragile, "Fragile", 0 ));
260  pComp->Value(mkNamingAdapt(Projectile, "Projectile", 0 ));
261 
262  pComp->Value(mkNamingAdapt(NoPushEnter, "NoPushEnter", 0 ));
263  pComp->Value(mkNamingAdapt(VehicleControl, "VehicleControl", 0 ));
264  pComp->Value(mkNamingAdapt(Pathfinder, "Pathfinder", 0 ));
265  pComp->Value(mkNamingAdapt(MoveToRange, "MoveToRange", 0 ));
266  pComp->Value(mkNamingAdapt(NoMassFromContents, "NoMassFromContents", 0 ));
267  pComp->Value(mkNamingAdapt(NoStabilize, "NoStabilize", 0 ));
268  pComp->Value(mkNamingAdapt(ClosedContainer, "ClosedContainer", 0 ));
269  pComp->Value(mkNamingAdapt(SilentCommands, "SilentCommands", 0 ));
270  pComp->Value(mkNamingAdapt(TemporaryCrew, "TemporaryCrew", 0 ));
271  pComp->Value(mkNamingAdapt(BlitMode, "BlitMode", C4D_Blit_Normal ));
272  pComp->Value(mkNamingAdapt(NoBreath, "NoBreath", 0 ));
273  pComp->Value(mkNamingAdapt(ConSizeOff, "ConSizeOff", 0 ));
274  pComp->Value(mkNamingAdapt(NoGet, "NoGet", 0 ));
275  pComp->Value(mkNamingAdapt(NoTransferZones, "NoTransferZones", 0 ));
276 
277  const StdBitfieldEntry<int32_t> AllowPictureStackModes[] =
278  {
279 
280  { "APS_Color", APS_Color },
281  { "APS_Graphics", APS_Graphics },
282  { "APS_Name", APS_Name },
283  { "APS_Overlay", APS_Overlay },
284  { nullptr, 0 }
285  };
286 
287  pComp->Value(mkNamingAdapt(mkBitfieldAdapt<int32_t>(AllowPictureStack, AllowPictureStackModes), //undocumented
288  "AllowPictureStack", 0 ));
289  pComp->Value(mkNamingAdapt(HideInCreator, "HideInCreator", false));
290 }
int32_t Pathfinder
Definition: C4Def.h:137
#define toC4CArr(rArr)
Definition: StdAdaptors.h:29
int32_t Line
Definition: C4Def.h:128
int32_t Exclusive
Definition: C4Def.h:118
Definition: StdAdaptors.h:848
int32_t UprightAttach
Definition: C4Def.h:127
const int32_t C4D_Environment
Definition: C4Def.h:50
int32_t AttractLightning
Definition: C4Def.h:131
const int32_t C4D_Vehicle
Definition: C4Def.h:44
int32_t NoTransferZones
Definition: C4Def.h:149
int32_t Float
Definition: C4Def.h:122
C4Rect PictureRect
Definition: C4Def.h:109
int32_t LineIntersect
Definition: C4Def.h:129
#define C4D_Blit_Normal
Definition: C4Def.h:96
int32_t Projectile
Definition: C4Def.h:134
int32_t NativeCrew
Definition: C4Def.h:115
int32_t Mass
Definition: C4Def.h:116
int32_t SilentCommands
Definition: C4Def.h:142
int32_t NoHorizontalMove
Definition: C4Def.h:124
const C4TargetRect TargetRect0(0, 0, 0, 0, 0, 0)
const int32_t C4D_Grab_Get
Definition: C4Def.h:65
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:93
int32_t Rotateable
Definition: C4Def.h:121
int32_t NoPushEnter
Definition: C4Def.h:135
const int32_t C4D_IgnoreFoW
Definition: C4Def.h:57
const int32_t C4D_MouseSelect
Definition: C4Def.h:54
const int32_t C4D_Grab_Put
Definition: C4Def.h:64
const int32_t C4D_Object
Definition: C4Def.h:46
int32_t GrowthType
Definition: C4Def.h:113
C4Shape Shape
Definition: C4Def.h:106
int32_t VehicleControl
Definition: C4Def.h:136
bool HideInCreator
Definition: C4Def.h:151
StdBitfieldAdapt< T > mkBitfieldAdapt(T &rVal, const StdBitfieldEntry< T > *pNames)
Definition: StdAdaptors.h:951
C4Rect Collection
Definition: C4Def.h:108
int32_t Constructable
Definition: C4Def.h:120
static const C4ID None
Definition: C4Id.h:42
int32_t NoMassFromContents
Definition: C4Def.h:139
int32_t ClosedContainer
Definition: C4Def.h:141
int32_t Value
Definition: C4Def.h:117
const C4Rect Rect0(0, 0, 0, 0)
const int32_t C4D_Background
Definition: C4Def.h:52
const int32_t C4D_StaticBack
Definition: C4Def.h:42
int32_t LiftTop
Definition: C4Def.h:125
int32_t rC4XVer[2]
Definition: C4Def.h:104
void Value(const T &rStruct)
Definition: StdCompiler.h:170
const int32_t C4D_Rule
Definition: C4Def.h:49
C4TargetRect SolidMask
Definition: C4Def.h:110
int32_t Oversize
Definition: C4Def.h:132
int32_t CrewMember
Definition: C4Def.h:114
C4TargetRect TopFace
Definition: C4Def.h:111
const int32_t C4D_Structure
Definition: C4Def.h:43
C4IDList RequireDef
Definition: C4Def.h:105
int32_t ColorByOwner
Definition: C4Def.h:123
int32_t IncompleteActivity
Definition: C4Def.h:130
const int32_t C4D_MouseIgnore
Definition: C4Def.h:56
const int32_t C4D_Living
Definition: C4Def.h:45
int32_t NoStabilize
Definition: C4Def.h:140
int32_t NoBreath
Definition: C4Def.h:145
int32_t MoveToRange
Definition: C4Def.h:138
int32_t GrabPutGet
Definition: C4Def.h:126
int32_t Category
Definition: C4Def.h:119
int32_t AllowPictureStack
Definition: C4Def.h:150
int32_t BlitMode
Definition: C4Def.h:144
const int32_t C4D_Goal
Definition: C4Def.h:48
int32_t NoGet
Definition: C4Def.h:147
StdParameterAdapt< T, P > mkParAdapt(T &&rObj, P &&rPar)
Definition: StdAdaptors.h:456
const int32_t C4D_Parallax
Definition: C4Def.h:53
C4Rect Entrance
Definition: C4Def.h:107
int32_t TemporaryCrew
Definition: C4Def.h:143
int32_t Fragile
Definition: C4Def.h:133
const int32_t C4D_None
Definition: C4Def.h:40
int32_t RotatedEntrance
Definition: C4Def.h:148
int32_t ConSizeOff
Definition: C4Def.h:146
const int32_t C4D_Foreground
Definition: C4Def.h:55

Here is the call graph for this function:

void C4Def::CrossMapActMap ( )
protected
bool C4Def::Decompile ( StdStrBuf pOut,
const char *  szName 
)
protected

Definition at line 179 of file C4Def.cpp.

References mkNamingAdapt().

Referenced by Save().

180 {
181  return DecompileToBuf_Log<StdCompilerINIWrite>(mkNamingAdapt(*this, "DefCore"), pOut, szName);
182 }
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:93

Here is the call graph for this function:

Here is the caller graph for this function:

void C4Def::Default ( )

Definition at line 302 of file C4Def.cpp.

References C4ComponentHost::Clear(), C4ScriptHost::Clear(), Count, Creation, DefaultDefCore(), fClonkNamesOwned, Filename, fRankNamesOwned, fRankSymbolsOwned, iNumRankSymbols, MainFace, Next, pClonkNames, pRankNames, pRankSymbols, pSolidMask, Script, C4Facet::Set(), StringTable, and Temporary.

303 {
304  DefaultDefCore();
305  Next=nullptr;
306  Temporary=false;
307  Filename[0]=0;
308  Creation=0;
309  Count=0;
310  MainFace.Set(nullptr,0,0,0,0);
311  Script.Clear();
312  StringTable.Clear();
313  pClonkNames=nullptr;
314  pRankNames=nullptr;
315  pRankSymbols=nullptr;
317  iNumRankSymbols=1;
318  pSolidMask = nullptr;
319 }
void DefaultDefCore()
Definition: C4Def.cpp:93
int32_t iNumRankSymbols
Definition: C4Def.h:193
int32_t Creation
Definition: C4Def.h:181
CSurface8 * pSolidMask
Definition: C4Def.h:195
C4Def * Next
Definition: C4Def.h:201
C4ComponentHost * pClonkNames
Definition: C4Def.h:188
void Set(C4Surface &rSfc)
Definition: C4Facet.cpp:459
bool fRankSymbolsOwned
Definition: C4Def.h:192
bool fRankNamesOwned
Definition: C4Def.h:191
bool Temporary
Definition: C4Def.h:202
int32_t Count
Definition: C4Def.h:182
C4Facet MainFace
Definition: C4Def.h:198
C4FacetSurface * pRankSymbols
Definition: C4Def.h:192
C4LangStringTable StringTable
Definition: C4Def.h:185
C4DefScriptHost Script
Definition: C4Def.h:184
char Filename[_MAX_FNAME+1]
Definition: C4Def.h:179
C4RankSystem * pRankNames
Definition: C4Def.h:191
bool fClonkNamesOwned
Definition: C4Def.h:188

Here is the call graph for this function:

void C4Def::DefaultDefCore ( )

Definition at line 93 of file C4Def.cpp.

References AttractLightning, BlitMode, BurnTurnTo, C4D_Blit_Normal, Category, C4IDList::Clear(), ClosedContainer, Collection, ColorByOwner, ConSizeOff, Constructable, CrewMember, C4Rect::Default(), C4Shape::Default(), C4TargetRect::Default(), Entrance, Exclusive, Float, Fragile, GrabPutGet, GrowthType, HideInCreator, IncompleteActivity, LiftTop, Line, LineIntersect, Mass, MoveToRange, NativeCrew, NoBreath, NoGet, NoHorizontalMove, NoMassFromContents, C4ID::None, NoPushEnter, NoStabilize, NoTransferZones, Oversize, Pathfinder, PictureRect, Projectile, rC4XVer, RequireDef, Rotateable, RotatedEntrance, Shape, SilentCommands, SolidMask, TemporaryCrew, TopFace, UprightAttach, Value, and VehicleControl.

Referenced by Default().

94 {
95  rC4XVer[0]=rC4XVer[1]=0;
96  RequireDef.Clear();
97  Shape.Default();
98  Entrance.Default();
101  SolidMask.Default();
102  TopFace.Default();
104  GrowthType=0;
105  CrewMember=0;
106  NativeCrew=0;
107  Mass=0;
108  Value=0;
109  Exclusive=0;
110  Category=0;
111  Constructable=0;
112  Rotateable=0;
113  RotatedEntrance=0;
114  Float=0;
115  ColorByOwner=0;
117  LiftTop=0;
118  GrabPutGet=0;
119  UprightAttach=0;
120  Line=0;
121  LineIntersect=0;
124  Oversize=0;
125  Fragile=0;
126  NoPushEnter=0;
127  Projectile=0;
128  VehicleControl=0;
129  Pathfinder=0;
131  MoveToRange=0;
132  NoStabilize=0;
133  ClosedContainer=0;
134  SilentCommands=0;
135  TemporaryCrew=0;
137  NoBreath=0;
138  ConSizeOff=0;
139  NoGet=0;
140  NoTransferZones=0;
141  HideInCreator = false;
142 }
int32_t Pathfinder
Definition: C4Def.h:137
int32_t Line
Definition: C4Def.h:128
int32_t Exclusive
Definition: C4Def.h:118
void Clear()
Definition: stub-handle.cpp:64
int32_t UprightAttach
Definition: C4Def.h:127
int32_t AttractLightning
Definition: C4Def.h:131
int32_t NoTransferZones
Definition: C4Def.h:149
int32_t Float
Definition: C4Def.h:122
C4Rect PictureRect
Definition: C4Def.h:109
int32_t LineIntersect
Definition: C4Def.h:129
#define C4D_Blit_Normal
Definition: C4Def.h:96
int32_t Projectile
Definition: C4Def.h:134
int32_t NativeCrew
Definition: C4Def.h:115
void Default()
Definition: C4Shape.cpp:36
int32_t Mass
Definition: C4Def.h:116
int32_t SilentCommands
Definition: C4Def.h:142
int32_t NoHorizontalMove
Definition: C4Def.h:124
int32_t Rotateable
Definition: C4Def.h:121
int32_t NoPushEnter
Definition: C4Def.h:135
C4ID BurnTurnTo
Definition: C4Def.h:112
int32_t GrowthType
Definition: C4Def.h:113
C4Shape Shape
Definition: C4Def.h:106
int32_t VehicleControl
Definition: C4Def.h:136
bool HideInCreator
Definition: C4Def.h:151
C4Rect Collection
Definition: C4Def.h:108
int32_t Constructable
Definition: C4Def.h:120
static const C4ID None
Definition: C4Id.h:42
int32_t NoMassFromContents
Definition: C4Def.h:139
int32_t ClosedContainer
Definition: C4Def.h:141
int32_t Value
Definition: C4Def.h:117
void Default()
Definition: C4Rect.cpp:26
int32_t LiftTop
Definition: C4Def.h:125
int32_t rC4XVer[2]
Definition: C4Def.h:104
C4TargetRect SolidMask
Definition: C4Def.h:110
int32_t Oversize
Definition: C4Def.h:132
int32_t CrewMember
Definition: C4Def.h:114
C4TargetRect TopFace
Definition: C4Def.h:111
C4IDList RequireDef
Definition: C4Def.h:105
int32_t ColorByOwner
Definition: C4Def.h:123
int32_t IncompleteActivity
Definition: C4Def.h:130
int32_t NoStabilize
Definition: C4Def.h:140
int32_t NoBreath
Definition: C4Def.h:145
int32_t MoveToRange
Definition: C4Def.h:138
int32_t GrabPutGet
Definition: C4Def.h:126
int32_t Category
Definition: C4Def.h:119
int32_t BlitMode
Definition: C4Def.h:144
int32_t NoGet
Definition: C4Def.h:147
C4Rect Entrance
Definition: C4Def.h:107
int32_t TemporaryCrew
Definition: C4Def.h:143
int32_t Fragile
Definition: C4Def.h:133
int32_t RotatedEntrance
Definition: C4Def.h:148
void Default()
Definition: C4Rect.cpp:39
int32_t ConSizeOff
Definition: C4Def.h:146

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool C4Def::Delete ( )
inlinevirtual

Reimplemented from C4PropList.

Definition at line 219 of file C4Def.h.

219 { return false; }
void C4PropList::Denumerate ( C4ValueNumbers numbers)
virtualinherited

Reimplemented in C4Object, C4AulScriptEngine, and C4Effect.

Definition at line 329 of file C4PropList.cpp.

References C4Value::Denumerate(), C4Set< T >::First(), C4Set< T >::Next(), C4PropList::RemoveCyclicPrototypes(), and C4Property::Value.

Referenced by C4Value::Denumerate(), and C4Object::Denumerate().

330 {
331  const C4Property * p = Properties.First();
332  while (p)
333  {
334  const_cast<C4Value &>(p->Value).Denumerate(numbers);
335  p = Properties.Next(p);
336  }
337  prototype.Denumerate(numbers);
339 }
void RemoveCyclicPrototypes()
Definition: C4PropList.cpp:409
C4Value Value
Definition: C4PropList.h:57
virtual void Denumerate(C4ValueNumbers *)
Definition: C4PropList.cpp:329
void Denumerate(C4ValueNumbers *)
Definition: C4Value.cpp:253
T const * Next(T const *p) const
T const * First() const

Here is the call graph for this function:

Here is the caller graph for this function:

void C4Def::Draw ( C4Facet cgo,
bool  fSelected = false,
DWORD  iColor = 0,
C4Object pObj = nullptr,
int32_t  iPhaseX = 0,
int32_t  iPhaseY = 0,
C4DrawTransform trans = nullptr,
const char *  graphicsName = nullptr 
)

Definition at line 601 of file C4Def.cpp.

References C4RGB, C4DefGraphics::Draw(), C4Draw::DrawBoxDw(), C4DefGraphics::Get(), C4Object::GetGraphics(), Graphics, C4Facet::Hgt, pDraw, C4Facet::Surface, C4Facet::Wdt, C4Facet::X, and C4Facet::Y.

Referenced by C4MainMenu::ActivateGoals(), C4Object::ActivateMenu(), C4MainMenu::ActivateRules(), C4GameMessage::Draw(), C4DefList::Draw(), C4MouseControl::Draw(), C4ScriptGuiWindow::Draw(), C4Object::DrawPicture(), C4Game::DrawPropListSpecImage(), and C4Game::DrawTextSpecImage().

602 {
603  if(fSelected)
604  pDraw->DrawBoxDw(cgo.Surface, cgo.X, cgo.Y, cgo.X + cgo.Wdt - 1, cgo.Y + cgo.Hgt - 1, C4RGB(0xca, 0, 0));
605 
606  C4DefGraphics* graphics = pObj ? pObj->GetGraphics() : &Graphics;
607  if (graphicsName)
608  {
609  C4DefGraphics *other = graphics->Get(graphicsName);
610  if (other) graphics = other;
611  }
612  graphics->Draw(cgo, iColor, pObj, iPhaseX, iPhaseY, trans);
613 }
float Y
Definition: C4Facet.h:120
C4DefGraphics * Get(const char *szGrpName)
C4DefGraphics * GetGraphics() const
Definition: C4Object.h:340
void DrawBoxDw(C4Surface *sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr)
Definition: C4Draw.cpp:849
C4Draw * pDraw
Definition: C4Draw.cpp:45
#define C4RGB(r, g, b)
Definition: StdColors.h:28
void Draw(C4Facet &cgo, DWORD iColor, C4Object *pObj, int32_t iPhaseX, int32_t iPhaseY, C4DrawTransform *trans)
float Hgt
Definition: C4Facet.h:120
C4Surface * Surface
Definition: C4Facet.h:119
float Wdt
Definition: C4Facet.h:120
C4DefGraphics Graphics
Definition: C4Def.h:194
float X
Definition: C4Facet.h:120

Here is the call graph for this function:

Here is the caller graph for this function:

Iterator C4PropList::end ( )
inlineinherited

Definition at line 207 of file C4PropList.h.

Referenced by C4ParticleProperties::Set().

207 { return Iterator(); }

Here is the caller graph for this function:

C4String * C4PropList::EnumerateOwnFuncs ( C4String prev = 0) const
inherited

Definition at line 895 of file C4PropList.cpp.

References C4Set< T >::First(), C4Set< T >::Get(), C4Value::getFunction(), C4Property::Key, C4Set< T >::Next(), and C4Property::Value.

896 {
897  const C4Property * p = prev ? Properties.Next(&Properties.Get(prev)) : Properties.First();
898  while (p)
899  {
900  if (p->Value.getFunction())
901  return p->Key;
902  p = Properties.Next(p);
903  }
904  return 0;
905 }
C4Value Value
Definition: C4PropList.h:57
T & Get(H e) const
T const * Next(T const *p) const
C4String * Key
Definition: C4PropList.h:56
T const * First() const
C4AulFunc * getFunction() const
Definition: C4Value.h:119

Here is the call graph for this function:

void C4PropList::Freeze ( )
inlineinherited

Definition at line 130 of file C4PropList.h.

Referenced by C4PropList::FreezeAndMakeStaticRecursively().

130 { constant = true; }

Here is the caller graph for this function:

C4PropListStatic * C4PropList::FreezeAndMakeStaticRecursively ( std::vector< C4Value > *  prop_lists,
const C4PropListStatic parent = nullptr,
C4String key = nullptr 
)
inherited

Definition at line 284 of file C4PropList.cpp.

References C4VPropList(), C4PropList::Freeze(), C4PropList::FreezeAndMakeStaticRecursively(), C4PropListStatic::GetParent(), C4PropListStatic::GetParentKeyName(), C4PropList::GetPropertyByS(), C4Value::getPropList(), C4PropList::GetPrototype(), C4PropList::GetSortedLocalProperties(), C4PropList::IsStatic(), C4PropList::NewStatic(), C4Value::SetPropList(), and C4PropList::Status.

Referenced by C4PropList::FreezeAndMakeStaticRecursively(), and C4AulScriptEngine::Link().

285 {
286  Freeze();
287  // Already static?
288  C4PropListStatic *this_static = IsStatic();
289  if (!this_static)
290  {
291  // Make self static by creating a copy and replacing all references
292  this_static = NewStatic(GetPrototype(), parent, key);
293  this_static->Properties.Swap(&Properties); // grab properties
294  this_static->Status = Status;
295  C4Value holder = C4VPropList(this);
296  while (FirstRef && FirstRef->NextRef)
297  {
298  C4Value *ref = FirstRef;
299  if (ref == &holder) ref = ref->NextRef;
300  ref->SetPropList(this_static);
301  }
302  // store reference
303  if (prop_lists)
304  prop_lists->push_back(C4VPropList(this_static));
305  // "this" should be deleted as holder goes out of scope
306  }
307  // Iterate over sorted list of elements to make static
308  // Must iterate over sorted list because the order must be defined, just in case it's a network game
309  // and a non-static child proplist is available through different paths it should still get the same name
310  auto prop_names = this_static->GetSortedLocalProperties(false);
311  for (auto prop_name : prop_names)
312  {
313  C4Value child_val;
314  this_static->GetPropertyByS(prop_name, &child_val);
315  C4PropList *child_proplist = child_val.getPropList();
316  if (child_proplist)
317  {
318  // Avoid infinite recursion: Only freeze into unfrozen children and "true" static children
319  C4PropListStatic *child_static = child_proplist->IsStatic();
320  if (!child_static || (child_static->GetParent() == this_static && child_static->GetParentKeyName() == prop_name))
321  {
322  child_proplist->FreezeAndMakeStaticRecursively(prop_lists, this_static, prop_name);
323  }
324  }
325  }
326  return this_static;
327 }
C4PropListStatic * FreezeAndMakeStaticRecursively(std::vector< C4Value > *prop_lists, const C4PropListStatic *parent=nullptr, C4String *key=nullptr)
Definition: C4PropList.cpp:284
void Freeze()
Definition: C4PropList.h:130
virtual class C4PropListStatic * IsStatic()
Definition: C4PropList.h:87
C4String * GetParentKeyName()
Definition: C4PropList.h:272
std::vector< C4String * > GetSortedLocalProperties(bool add_prototype=true) const
Definition: C4PropList.cpp:535
virtual bool GetPropertyByS(const C4String *k, C4Value *pResult) const
Definition: C4PropList.cpp:712
C4Value C4VPropList(C4PropList *p)
Definition: C4Value.h:245
C4PropList * GetPrototype() const
Definition: C4PropList.h:83
int32_t Status
Definition: C4PropList.h:169
static C4PropListStatic * NewStatic(C4PropList *prototype, const C4PropListStatic *parent, C4String *key)
Definition: C4PropList.cpp:70
void SetPropList(C4PropList *PropList)
Definition: C4Value.h:141
const C4PropListStatic * GetParent() const
Definition: C4PropList.h:271
C4PropList * getPropList() const
Definition: C4Value.h:116

Here is the call graph for this function:

Here is the caller graph for this function:

C4PropList * C4Def::GetActionByName ( const char *  actname)

Definition at line 651 of file C4Def.cpp.

References C4RefCnt::DecRef(), C4RefCnt::IncRef(), C4StringTable::RegString(), and Strings.

652 {
653  if (!actname) return nullptr;
654  C4String * actname_str = Strings.RegString(actname);
655  actname_str->IncRef();
656  C4PropList *r = GetActionByName(actname_str);
657  actname_str->DecRef();
658  return r;
659 }
void IncRef()
Definition: C4StringTable.h:27
C4String * RegString(StdStrBuf String)
C4StringTable Strings
Definition: C4Globals.cpp:42
C4PropList * GetActionByName(const char *actname)
Definition: C4Def.cpp:651
void DecRef()
Definition: C4StringTable.h:28

Here is the call graph for this function:

C4PropList * C4Def::GetActionByName ( C4String actname)

Definition at line 661 of file C4Def.cpp.

References C4PropList::GetProperty(), C4PropList::GetPropertyByS(), C4Value::getPropList(), C4StringTable::P, P_ActMap, P_Idle, and Strings.

662 {
663  assert(actname);
664  // If we get the null string or ActIdle by name, return nullptr action
665  if (!actname || actname == &Strings.P[P_Idle]) return nullptr;
666  // otherwise, query actmap
667  C4Value ActMap; GetProperty(P_ActMap, &ActMap);
668  if (!ActMap.getPropList()) return nullptr;
669  C4Value Action; ActMap.getPropList()->GetPropertyByS(actname, &Action);
670  if (!Action.getPropList()) return nullptr;
671  return Action.getPropList();
672 }
C4String P[P_LAST]
bool GetProperty(C4PropertyName k, C4Value *pResult) const
Definition: C4PropList.h:103
C4StringTable Strings
Definition: C4Globals.cpp:42
virtual bool GetPropertyByS(const C4String *k, C4Value *pResult) const
Definition: C4PropList.cpp:712
C4PropList * getPropList() const
Definition: C4Value.h:116

Here is the call graph for this function:

StdStrBuf C4PropListStatic::GetDataString ( ) const
inherited

Definition at line 253 of file C4PropList.cpp.

References StdStrBuf::Append(), StdStrBuf::AppendChar(), C4String::GetData(), C4PropListStatic::GetDataString(), C4PropListStatic::Parent, C4PropListStatic::ParentKeyName, and StdStrBuf::Take().

Referenced by C4Value::GetDataString(), C4PropListStatic::GetDataString(), C4AulFunc::GetFullName(), C4DefScriptHost::Parse(), and C4AulScriptContext::ReturnDump().

254 {
255  StdStrBuf r;
256  if (Parent)
257  {
258  r.Take(Parent->GetDataString());
259  r.AppendChar('.');
260  }
261  assert(ParentKeyName);
262  if (ParentKeyName)
264  return r;
265 }
StdStrBuf GetData() const
Definition: C4StringTable.h:50
void AppendChar(char cChar)
Definition: StdBuf.h:596
void Take(char *pnData)
Definition: StdBuf.h:465
void Append(const char *pnData, size_t iChars)
Definition: StdBuf.h:527
const C4PropListStatic * Parent
Definition: C4PropList.h:274
C4RefCntPointer< C4String > ParentKeyName
Definition: C4PropList.h:275
StdStrBuf GetDataString() const
Definition: C4PropList.cpp:253

Here is the call graph for this function:

Here is the caller graph for this function:

virtual C4Def const* C4Def::GetDef ( ) const
inlinevirtual

Reimplemented from C4PropList.

Definition at line 217 of file C4Def.h.

217 { return this; }
virtual C4Def* C4Def::GetDef ( )
inlinevirtual

Reimplemented from C4PropList.

Definition at line 218 of file C4Def.h.

218 { return this; }
C4Effect * C4PropList::GetEffect ( )
virtualinherited

Reimplemented in C4Effect.

Definition at line 664 of file C4PropList.cpp.

References C4PropList::GetEffect(), and C4PropList::GetPrototype().

Referenced by C4ValueConv< C4Effect * >::_FromC4V(), C4Value::GetDataString(), and C4PropList::GetEffect().

665 {
666  if (GetPrototype()) return GetPrototype()->GetEffect();
667  return 0;
668 }
C4PropList * GetPrototype() const
Definition: C4PropList.h:83
virtual C4Effect * GetEffect()
Definition: C4PropList.cpp:664

Here is the call graph for this function:

Here is the caller graph for this function:

C4AulFunc* C4PropList::GetFunc ( C4PropertyName  k) const
inlineinherited

Definition at line 107 of file C4PropList.h.

References C4StringTable::P, and Strings.

Referenced by C4Effect::AssignCallbackFunctions(), C4PropList::Call(), C4Effect::CallDamage(), C4Value::CompileFunc(), C4ScriptHost::CopyPropList(), C4Effect::DoCall(), C4PropList::GetFunc(), C4Effect::Init(), C4MapScriptHost::InitializeMap(), C4Object::PutAwayUnusedObject(), C4MaterialReaction::ResolveScriptFuncs(), C4MCOverlay::SetField(), C4AulCompiler::PreparseAstVisitor::visit(), and C4AulCompiler::CodegenAstVisitor::visit().

108  { return GetFunc(&Strings.P[k]); }
C4String P[P_LAST]
C4AulFunc * GetFunc(C4PropertyName k) const
Definition: C4PropList.h:107
C4StringTable Strings
Definition: C4Globals.cpp:42

Here is the caller graph for this function:

C4AulFunc * C4PropList::GetFunc ( C4String k) const
inherited

Definition at line 758 of file C4PropList.cpp.

References C4Set< T >::Get(), C4PropList::GetFunc(), C4Value::getFunction(), C4PropList::GetPrototype(), C4Set< T >::Has(), and C4Property::Value.

759 {
760  assert(k);
761  if (Properties.Has(k))
762  {
763  return Properties.Get(k).Value.getFunction();
764  }
765  if (GetPrototype())
766  {
767  return GetPrototype()->GetFunc(k);
768  }
769  return 0;
770 }
C4Value Value
Definition: C4PropList.h:57
bool Has(H e) const
C4AulFunc * GetFunc(C4PropertyName k) const
Definition: C4PropList.h:107
T & Get(H e) const
C4PropList * GetPrototype() const
Definition: C4PropList.h:83
C4AulFunc * getFunction() const
Definition: C4Value.h:119

Here is the call graph for this function:

C4AulFunc * C4PropList::GetFunc ( const char *  k) const
inherited

Definition at line 772 of file C4PropList.cpp.

References C4StringTable::FindString(), C4PropList::GetFunc(), s, and Strings.

773 {
774  assert(s);
775  if (s[0] == '~') ++s;
776  C4String * k = Strings.FindString(s);
777  // this string is entirely unused
778  if (!k)
779  return 0;
780  return GetFunc(k);
781 }
C4String * FindString(const char *strString) const
C4AulFunc * GetFunc(C4PropertyName k) const
Definition: C4PropList.h:107
C4StringTable Strings
Definition: C4Globals.cpp:42
#define s

Here is the call graph for this function:

C4Facet& C4Def::GetMainFace ( C4DefGraphics pGraphics,
DWORD  dwClr = 0 
)
inline

Definition at line 213 of file C4Def.h.

References C4DefGraphics::GetBitmap(), MainFace, and C4Facet::Surface.

213 { MainFace.Surface=pGraphics->GetBitmap(dwClr); return MainFace; }
C4Surface * GetBitmap(DWORD dwClr=0)
C4Facet MainFace
Definition: C4Def.h:198
C4Surface * Surface
Definition: C4Facet.h:119

Here is the call graph for this function:

class C4MapScriptLayer * C4PropList::GetMapScriptLayer ( )
virtualinherited

Reimplemented in C4MapScriptLayer.

Definition at line 646 of file C4PropList.cpp.

References C4PropList::GetMapScriptLayer(), and C4PropList::GetPrototype().

Referenced by C4MapScriptAlgoLayer::C4MapScriptAlgoLayer(), FnParAlgo(), and C4PropList::GetMapScriptLayer().

647 {
648  if (GetPrototype()) return GetPrototype()->GetMapScriptLayer();
649  return nullptr;
650 }
C4PropList * GetPrototype() const
Definition: C4PropList.h:83
virtual class C4MapScriptLayer * GetMapScriptLayer()
Definition: C4PropList.cpp:646

Here is the call graph for this function:

Here is the caller graph for this function:

class C4MapScriptMap * C4PropList::GetMapScriptMap ( )
virtualinherited

Reimplemented in C4MapScriptMap.

Definition at line 652 of file C4PropList.cpp.

References C4PropList::GetMapScriptMap(), and C4PropList::GetPrototype().

Referenced by C4PropList::GetMapScriptMap().

653 {
654  if (GetPrototype()) return GetPrototype()->GetMapScriptMap();
655  return nullptr;
656 }
C4PropList * GetPrototype() const
Definition: C4PropList.h:83
virtual class C4MapScriptMap * GetMapScriptMap()
Definition: C4PropList.cpp:652

Here is the call graph for this function:

Here is the caller graph for this function:

const char * C4PropListStatic::GetName ( ) const
virtualinherited

Reimplemented from C4PropList.

Definition at line 267 of file C4PropList.cpp.

References C4String::GetCStr(), C4PropList::GetPropertyStr(), P_Name, C4PropListStatic::ParentKeyName, and s.

Referenced by C4MainMenu::ActivateGoals(), C4MainMenu::ActivateRules(), C4Object::AssignRemoval(), C4DefGraphicsAdapt::CompileFunc(), ConstructionCheck(), C4ObjectInfoCore::Default(), C4Command::Fail(), C4GameParameters::GetGameGoalString(), C4ObjectList::GetNameList(), LoadDefCore(), C4DefScriptHost::Parse(), and C4EditCursor::UpdateStatusBar().

268 {
269  const C4String * s = GetPropertyStr(P_Name);
270  if (!s) s = ParentKeyName;
271  if (!s) return "";
272  return s->GetCStr();
273 }
const char * GetCStr() const
Definition: C4StringTable.h:49
C4String * GetPropertyStr(C4PropertyName k) const
Definition: C4PropList.cpp:730
#define s
C4RefCntPointer< C4String > ParentKeyName
Definition: C4PropList.h:275

Here is the call graph for this function:

Here is the caller graph for this function:

C4Object * C4PropList::GetObject ( )
virtualinherited

Reimplemented in C4Object.

Definition at line 622 of file C4PropList.cpp.

References C4PropList::GetObject(), and C4PropList::GetPrototype().

Referenced by C4Value::_getObj(), C4EditCursor::AddToSelection(), C4ScriptGuiWindowAction::ClearPointers(), ThisImpl< C4Object >::Conv(), C4GameMessage::Draw(), C4ScriptGuiWindowAction::ExecuteCommand(), FnGetEffectsFor(), C4Value::GetDataString(), C4Value::getObj(), C4PropList::GetObject(), C4GameMessage::Init(), Object(), C4GameObjects::ObjectPointer(), C4EditCursor::RemoveFromSelection(), and C4ScriptGuiWindowProperty::Set().

623 {
624  if (GetPrototype()) return GetPrototype()->GetObject();
625  return 0;
626 }
virtual C4Object * GetObject()
Definition: C4PropList.cpp:622
C4PropList * GetPrototype() const
Definition: C4PropList.h:83

Here is the call graph for this function:

Here is the caller graph for this function:

C4Object const * C4PropList::GetObject ( ) const
virtualinherited

Reimplemented in C4Object.

Definition at line 628 of file C4PropList.cpp.

References C4PropList::GetObject(), and C4PropList::GetPrototype().

629 {
630  if (GetPrototype()) return GetPrototype()->GetObject();
631  return 0;
632 }
virtual C4Object * GetObject()
Definition: C4PropList.cpp:622
C4PropList * GetPrototype() const
Definition: C4PropList.h:83

Here is the call graph for this function:

const C4PropListStatic* C4PropListStatic::GetParent ( ) const
inlineinherited

Definition at line 271 of file C4PropList.h.

References C4PropListStatic::Parent.

Referenced by C4ScriptHost::CopyPropList(), C4PropList::FreezeAndMakeStaticRecursively(), C4Value::GetDataString(), and C4Value::ToJSON().

271 { return Parent; }
const C4PropListStatic * Parent
Definition: C4PropList.h:274

Here is the caller graph for this function:

C4String* C4PropListStatic::GetParentKeyName ( )
inlineinherited

Definition at line 272 of file C4PropList.h.

References C4PropListStatic::ParentKeyName.

Referenced by C4PropList::FreezeAndMakeStaticRecursively().

272 { return ParentKeyName; }
C4RefCntPointer< C4String > ParentKeyName
Definition: C4PropList.h:275

Here is the caller graph for this function:

int32_t C4Def::GetPlane ( )
inline

Definition at line 214 of file C4Def.h.

References C4PropList::GetPropertyInt(), and P_Plane.

Referenced by C4Object::Init(), and C4DefScriptHost::Parse().

214 { return GetPropertyInt(P_Plane); }
int32_t GetPropertyInt(C4PropertyName k, int32_t default_val=0) const
Definition: C4PropList.cpp:841

Here is the call graph for this function:

Here is the caller graph for this function:

C4ValueArray * C4PropList::GetProperties ( ) const
virtualinherited

Reimplemented in C4Object, and C4Effect.

Definition at line 869 of file C4PropList.cpp.

References a, C4V_String, C4VString(), C4Set< T >::First(), C4PropList::GetProperties(), C4PropList::GetPrototype(), C4ValueArray::GetSize(), C4Set< T >::GetSize(), C4Property::Key, C4Set< T >::Next(), and C4ValueArray::SetSize().

Referenced by C4ScriptGuiWindow::CreateFromPropList(), C4PropList::GetProperties(), C4Effect::GetProperties(), C4Object::GetProperties(), and C4ScriptGuiWindowProperty::Set().

870 {
871  C4ValueArray * a;
872  int i;
873  if (GetPrototype())
874  {
875  a = GetPrototype()->GetProperties();
876  i = a->GetSize();
877  a->SetSize(i + Properties.GetSize());
878  }
879  else
880  {
881  a = new C4ValueArray(Properties.GetSize());
882  i = 0;
883  }
884  const C4Property * p = Properties.First();
885  while (p)
886  {
887  assert(p->Key != nullptr && "Proplist key is nullpointer");
888  (*a)[i++] = C4VString(p->Key);
889  assert(((*a)[i - 1].GetType() == C4V_String) && "Proplist key is non-string");
890  p = Properties.Next(p);
891  }
892  return a;
893 }
#define a
T const * Next(T const *p) const
unsigned int GetSize() const
virtual C4ValueArray * GetProperties() const
Definition: C4PropList.cpp:869
C4PropList * GetPrototype() const
Definition: C4PropList.h:83
void SetSize(int32_t inSize)
int32_t GetSize() const
Definition: C4ValueArray.h:36
C4String * Key
Definition: C4PropList.h:56
C4Value C4VString(C4String *pStr)
Definition: C4Value.h:246
T const * First() const

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4PropList::GetProperty ( C4PropertyName  k,
C4Value pResult 
) const
inlineinherited

Definition at line 103 of file C4PropList.h.

References C4PropList::GetPropertyByS(), C4StringTable::P, and Strings.

Referenced by C4MapScriptAlgoFilter::C4MapScriptAlgoFilter(), C4MapScriptAlgoModifier::C4MapScriptAlgoModifier(), C4MapScriptAlgoPolygon::C4MapScriptAlgoPolygon(), C4MapScriptAlgoRndChecker::C4MapScriptAlgoRndChecker(), C4FindObjectProcedure::Check(), C4DefGraphics::Draw(), C4GraphicsOverlay::Draw(), C4Object::DrawFaceImpl(), C4Object::DrawLine(), C4Object::ExecAction(), C4Object::GetAction(), GetActionByName(), C4Object::GetDragImage(), C4Object::GetParallaxity(), C4MapScriptAlgo::GetXYProps(), C4GameMessage::Init(), C4Object::IsVisible(), C4ScriptUniform::Push(), C4Object::SetAction(), C4Object::SetActionByName(), and C4GraphicsOverlay::UpdateFacet().

104  { return GetPropertyByS(&Strings.P[k], pResult); }
C4String P[P_LAST]
C4StringTable Strings
Definition: C4Globals.cpp:42
virtual bool GetPropertyByS(const C4String *k, C4Value *pResult) const
Definition: C4PropList.cpp:712

Here is the call graph for this function:

Here is the caller graph for this function:

C4ValueArray * C4PropList::GetPropertyArray ( C4PropertyName  n) const
inherited

Definition at line 744 of file C4PropList.cpp.

References C4Set< T >::Get(), C4Value::getArray(), C4PropList::GetPropertyArray(), C4PropList::GetPrototype(), C4Set< T >::Has(), C4StringTable::P, Strings, and C4Property::Value.

Referenced by C4EditCursor::DoContextMenu(), C4PropList::GetPropertyArray(), and C4FoWLight::Update().

745 {
746  C4String * k = &Strings.P[n];
747  if (Properties.Has(k))
748  {
749  return Properties.Get(k).Value.getArray();
750  }
751  if (GetPrototype())
752  {
753  return GetPrototype()->GetPropertyArray(n);
754  }
755  return 0;
756 }
C4String P[P_LAST]
C4Value Value
Definition: C4PropList.h:57
bool Has(H e) const
T & Get(H e) const
C4StringTable Strings
Definition: C4Globals.cpp:42
C4PropList * GetPrototype() const
Definition: C4PropList.h:83
C4ValueArray * getArray() const
Definition: C4Value.h:118
C4ValueArray * GetPropertyArray(C4PropertyName n) const
Definition: C4PropList.cpp:744

Here is the call graph for this function:

Here is the caller graph for this function:

int32_t C4PropList::GetPropertyBool ( C4PropertyName  n,
bool  default_val = false 
) const
inherited

Definition at line 827 of file C4PropList.cpp.

References C4Set< T >::Get(), C4Value::getBool(), C4PropList::GetPropertyBool(), C4PropList::GetPrototype(), C4Set< T >::Has(), C4StringTable::P, Strings, and C4Property::Value.

Referenced by C4PropList::GetPropertyBool().

828 {
829  C4String * k = &Strings.P[n];
830  if (Properties.Has(k))
831  {
832  return Properties.Get(k).Value.getBool();
833  }
834  if (GetPrototype())
835  {
836  return GetPrototype()->GetPropertyBool(n, default_val);
837  }
838  return default_val;
839 }
C4String P[P_LAST]
C4Value Value
Definition: C4PropList.h:57
bool Has(H e) const
bool getBool() const
Definition: C4Value.h:113
int32_t GetPropertyBool(C4PropertyName n, bool default_val=false) const
Definition: C4PropList.cpp:827
T & Get(H e) const
C4StringTable Strings
Definition: C4Globals.cpp:42
C4PropList * GetPrototype() const
Definition: C4PropList.h:83

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4PropList::GetPropertyByS ( const C4String k,
C4Value pResult 
) const
virtualinherited

Reimplemented in C4Object, and C4Effect.

Definition at line 712 of file C4PropList.cpp.

References C4Set< T >::Get(), C4PropList::GetPropertyByS(), C4PropList::GetPrototype(), C4Set< T >::Has(), C4StringTable::P, P_Prototype, Strings, and C4Property::Value.

Referenced by C4Value::CompileFunc(), C4ScriptGuiWindow::CreateFromPropList(), C4PropList::FreezeAndMakeStaticRecursively(), GetActionByName(), C4DefList::GetAllDefs(), C4PropList::GetProperty(), C4PropList::GetPropertyByS(), C4Effect::GetPropertyByS(), C4Object::GetPropertyByS(), C4ValueArraySortPropertycomp::operator()(), C4ScriptGuiWindowProperty::Set(), C4Object::SetActionByName(), C4ScriptHost::UnlinkOwnedFunctions(), C4GraphicsOverlay::UpdateFacet(), and C4AulCompiler::ConstexprEvaluator::visit().

713 {
714  if (Properties.Has(k))
715  {
716  *pResult = Properties.Get(k).Value;
717  return true;
718  }
719  else if (k == &Strings.P[P_Prototype])
720  {
721  *pResult = prototype;
722  return true;
723  }
724  else if(GetPrototype())
725  return GetPrototype()->GetPropertyByS(k, pResult);
726  else
727  return false;
728 }
C4String P[P_LAST]
C4Value Value
Definition: C4PropList.h:57
bool Has(H e) const
T & Get(H e) const
C4StringTable Strings
Definition: C4Globals.cpp:42
virtual bool GetPropertyByS(const C4String *k, C4Value *pResult) const
Definition: C4PropList.cpp:712
C4PropList * GetPrototype() const
Definition: C4PropList.h:83

Here is the call graph for this function:

Here is the caller graph for this function:

int32_t C4PropList::GetPropertyInt ( C4PropertyName  k,
int32_t  default_val = 0 
) const
inherited

Definition at line 841 of file C4PropList.cpp.

References C4Set< T >::Get(), C4Value::getInt(), C4PropList::GetPropertyInt(), C4PropList::GetPrototype(), C4Set< T >::Has(), C4StringTable::P, Strings, and C4Property::Value.

Referenced by C4MouseControl::ButtonUpDragScript(), C4MapScriptAlgoEllipsis::C4MapScriptAlgoEllipsis(), C4MapScriptAlgoLines::C4MapScriptAlgoLines(), C4MapScriptAlgoOffset::C4MapScriptAlgoOffset(), C4MapScriptAlgoPolygon::C4MapScriptAlgoPolygon(), C4MapScriptAlgoRect::C4MapScriptAlgoRect(), C4MapScriptAlgoRndChecker::C4MapScriptAlgoRndChecker(), C4MapScriptAlgoRotate::C4MapScriptAlgoRotate(), C4MapScriptAlgoScale::C4MapScriptAlgoScale(), C4MapScriptAlgoTurbulence::C4MapScriptAlgoTurbulence(), C4Object::Contact(), C4Object::ContactAction(), C4Object::DoBreath(), C4Object::DoEnergy(), C4Object::DoMovement(), C4MouseControl::DragNone(), C4Object::Draw(), C4Object::DrawActionFace(), C4Game::DrawPropListSpecImage(), C4Object::DrawTopFace(), C4Command::Enter(), C4Object::ExecAction(), C4Object::ExecLife(), C4Object::ExecMovement(), C4ValueProviderAction::Execute(), C4Command::Exit(), C4Command::FlightControl(), FnParAlgo(), C4SoundModifierList::Get(), C4SoundModifier::GetBoolProp(), C4SoundModifier::GetFloatProp(), GetPlane(), C4PropList::GetPropertyInt(), C4Object::GetSolidMaskPlane(), C4Object::Init(), C4Object::IsVisible(), C4Command::MoveTo(), ObjectActionThrow(), ObjectComDrop(), ObjectComJump(), C4Game::PlaceAnimal(), C4Game::PlaceVegetation(), C4Object::Push(), C4Command::Put(), C4Object::ResetProperty(), C4Object::SetAction(), C4Object::SetDir(), C4Object::SetOCF(), C4Object::SetPhase(), C4Object::SideBounds(), C4Command::Throw(), C4Object::UpdateActionFace(), C4MouseControl::UpdateCursorTarget(), C4GraphicsOverlay::UpdateFacet(), C4Object::UpdateFlipDir(), C4Object::UpdateOCF(), and C4Object::VerticalBounds().

842 {
843  C4String * k = &Strings.P[n];
844  if (Properties.Has(k))
845  {
846  return Properties.Get(k).Value.getInt();
847  }
848  if (GetPrototype())
849  {
850  return GetPrototype()->GetPropertyInt(n, default_val);
851  }
852  return default_val;
853 }
C4String P[P_LAST]
C4Value Value
Definition: C4PropList.h:57
bool Has(H e) const
T & Get(H e) const
C4StringTable Strings
Definition: C4Globals.cpp:42
C4PropList * GetPrototype() const
Definition: C4PropList.h:83
int32_t getInt() const
Definition: C4Value.h:112
int32_t GetPropertyInt(C4PropertyName k, int32_t default_val=0) const
Definition: C4PropList.cpp:841

Here is the call graph for this function:

Here is the caller graph for this function:

C4PropertyName C4PropList::GetPropertyP ( C4PropertyName  k) const
inherited

Definition at line 810 of file C4PropList.cpp.

References C4Set< T >::Get(), C4PropList::GetPropertyP(), C4PropList::GetPrototype(), C4Value::getStr(), C4Set< T >::Has(), C4StringTable::P, P_LAST, Strings, and C4Property::Value.

Referenced by C4Object::ContactAction(), C4Object::ExecAction(), C4Object::ExecMovement(), C4Object::GetProcedure(), C4PropList::GetPropertyP(), ObjectComDrop(), C4Object::SetAction(), C4Object::SideBounds(), and C4Object::VerticalBounds().

811 {
812  C4String * k = &Strings.P[n];
813  if (Properties.Has(k))
814  {
815  C4String * v = Properties.Get(k).Value.getStr();
816  if (v >= &Strings.P[0] && v < &Strings.P[P_LAST])
817  return C4PropertyName(v - &Strings.P[0]);
818  return P_LAST;
819  }
820  if (GetPrototype())
821  {
822  return GetPrototype()->GetPropertyP(n);
823  }
824  return P_LAST;
825 }
C4PropertyName GetPropertyP(C4PropertyName k) const
Definition: C4PropList.cpp:810
C4String P[P_LAST]
C4Value Value
Definition: C4PropList.h:57
C4String * getStr() const
Definition: C4Value.h:117
bool Has(H e) const
T & Get(H e) const
C4StringTable Strings
Definition: C4Globals.cpp:42
C4PropList * GetPrototype() const
Definition: C4PropList.h:83
C4PropertyName

Here is the call graph for this function:

Here is the caller graph for this function:

C4PropList * C4PropList::GetPropertyPropList ( C4PropertyName  k) const
inherited

Definition at line 855 of file C4PropList.cpp.

References C4Set< T >::Get(), C4PropList::GetPropertyPropList(), C4Value::getPropList(), C4PropList::GetPrototype(), C4Set< T >::Has(), C4StringTable::P, Strings, and C4Property::Value.

Referenced by C4MapScriptAlgoLayer::C4MapScriptAlgoLayer(), C4Game::DrawPropListSpecImage(), C4PropList::GetPropertyPropList(), and C4GameMessage::Init().

856 {
857  C4String * k = &Strings.P[n];
858  if (Properties.Has(k))
859  {
860  return Properties.Get(k).Value.getPropList();
861  }
862  if (GetPrototype())
863  {
864  return GetPrototype()->GetPropertyPropList(n);
865  }
866  return nullptr;
867 }
C4String P[P_LAST]
C4Value Value
Definition: C4PropList.h:57
bool Has(H e) const
T & Get(H e) const
C4StringTable Strings
Definition: C4Globals.cpp:42
C4PropList * GetPrototype() const
Definition: C4PropList.h:83
C4PropList * GetPropertyPropList(C4PropertyName k) const
Definition: C4PropList.cpp:855
C4PropList * getPropList() const
Definition: C4Value.h:116

Here is the call graph for this function:

Here is the caller graph for this function:

C4String * C4PropList::GetPropertyStr ( C4PropertyName  k) const
inherited

Definition at line 730 of file C4PropList.cpp.

References C4Set< T >::Get(), C4PropList::GetPropertyStr(), C4PropList::GetPrototype(), C4Value::getStr(), C4Set< T >::Has(), C4StringTable::P, Strings, and C4Property::Value.

Referenced by C4Game::DrawPropListSpecImage(), C4Object::ExecAction(), C4PropList::GetName(), C4PropListStatic::GetName(), C4PropList::GetPropertyStr(), C4Object::SetAction(), C4Object::SetDir(), C4MouseControl::UpdateCursorTarget(), and C4GraphicsOverlay::UpdateFacet().

731 {
732  C4String * k = &Strings.P[n];
733  if (Properties.Has(k))
734  {
735  return Properties.Get(k).Value.getStr();
736  }
737  if (GetPrototype())
738  {
739  return GetPrototype()->GetPropertyStr(n);
740  }
741  return 0;
742 }
C4String P[P_LAST]
C4Value Value
Definition: C4PropList.h:57
C4String * getStr() const
Definition: C4Value.h:117
bool Has(H e) const
T & Get(H e) const
C4StringTable Strings
Definition: C4Globals.cpp:42
C4PropList * GetPrototype() const
Definition: C4PropList.h:83
C4String * GetPropertyStr(C4PropertyName k) const
Definition: C4PropList.cpp:730

Here is the call graph for this function:

Here is the caller graph for this function:

C4PropListNumbered * C4PropList::GetPropListNumbered ( )
virtualinherited

Reimplemented in C4PropListNumbered.

Definition at line 658 of file C4PropList.cpp.

References C4PropList::GetPropListNumbered(), and C4PropList::GetPrototype().

Referenced by C4Effect::CompileFunc(), C4Value::CompileFunc(), C4AulExec::DirectExec(), and C4PropList::GetPropListNumbered().

659 {
660  if (GetPrototype()) return GetPrototype()->GetPropListNumbered();
661  return 0;
662 }
C4PropList * GetPrototype() const
Definition: C4PropList.h:83
virtual C4PropListNumbered * GetPropListNumbered()
Definition: C4PropList.cpp:658

Here is the call graph for this function:

Here is the caller graph for this function:

C4PropList* C4PropList::GetPrototype ( ) const
inlineinherited
std::vector< C4String * > C4PropList::GetSortedLocalProperties ( bool  add_prototype = true) const
inherited

Definition at line 535 of file C4PropList.cpp.

References C4Set< T >::GetSortedListOfElementPointers(), C4StringTable::P, P_Prototype, and Strings.

Referenced by C4PropList::FreezeAndMakeStaticRecursively().

536 {
537  // return property list without descending into prototype
538  std::list<const C4Property *> sorted_props = Properties.GetSortedListOfElementPointers();
539  std::vector< C4String * > result;
540  result.reserve(sorted_props.size() + add_prototype);
541  if (add_prototype) result.push_back(&::Strings.P[P_Prototype]); // implicit prototype for every prop list
542  for (auto p : sorted_props) result.push_back(p->Key);
543  return result;
544 }
C4String P[P_LAST]
std::list< const T * > GetSortedListOfElementPointers() const
C4StringTable Strings
Definition: C4Globals.cpp:42

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< C4String * > C4PropList::GetSortedLocalProperties ( const char *  prefix,
const C4PropList ignore_overridden 
) const
inherited

Definition at line 546 of file C4PropList.cpp.

References a, b, C4Set< T >::First(), C4String::GetCStr(), C4PropList::GetPrototype(), C4PropList::HasProperty(), C4Set< T >::Next(), C4StringTable::P, P_Prototype, and Strings.

547 {
548  // return property list without descending into prototype
549  // ignore properties that have been overridden by proplist given in ignore_overridden or any of its prototypes up to and excluding this
550  std::vector< C4String * > result;
551  for (const C4Property *pp = Properties.First(); pp; pp = Properties.Next(pp))
552  if (pp->Key != &::Strings.P[P_Prototype])
553  if (!prefix || pp->Key->GetData().BeginsWith(prefix))
554  {
555  // Override check
556  const C4PropList *check = ignore_overridden;
557  bool overridden = false;
558  if (check && check != this)
559  {
560  if (check->HasProperty(pp->Key)) { overridden = true; break; }
561  check = check->GetPrototype();
562  }
563  result.push_back(pp->Key);
564  }
565  // Sort
566  std::sort(result.begin(), result.end(), [](const C4String *a, const C4String *b) -> bool
567  {
568  return strcmp(a->GetCStr(), b->GetCStr()) < 0;
569  });
570  return result;
571 }
C4String P[P_LAST]
#define b
const char * GetCStr() const
Definition: C4StringTable.h:49
#define a
T const * Next(T const *p) const
C4StringTable Strings
Definition: C4Globals.cpp:42
C4PropList * GetPrototype() const
Definition: C4PropList.h:83
bool HasProperty(C4String *k) const
Definition: C4PropList.h:120
T const * First() const

Here is the call graph for this function:

std::vector< C4String * > C4PropList::GetSortedProperties ( const char *  prefix,
C4PropList ignore_parent = nullptr 
) const
inherited

Definition at line 591 of file C4PropList.cpp.

References a, b, C4String::GetCStr(), and C4PropList::GetUnsortedProperties().

592 {
593  // Return property list with descending into prototype
594  // But do not include Prototype property
595  std::vector< C4String * > result = GetUnsortedProperties(prefix, ignore_parent);
596  // Sort
597  std::sort(result.begin(), result.end(), [](const C4String *a, const C4String *b) -> bool
598  {
599  return strcmp(a->GetCStr(), b->GetCStr()) < 0;
600  });
601  return result;
602 }
#define b
const char * GetCStr() const
Definition: C4StringTable.h:49
#define a
std::vector< C4String * > GetUnsortedProperties(const char *prefix, C4PropList *ignore_parent=nullptr) const
Definition: C4PropList.cpp:573

Here is the call graph for this function:

std::vector< C4String * > C4PropList::GetUnsortedProperties ( const char *  prefix,
C4PropList ignore_parent = nullptr 
) const
inherited

Definition at line 573 of file C4PropList.cpp.

References C4Set< T >::First(), C4PropList::GetPrototype(), C4Set< T >::Next(), C4StringTable::P, P_Prototype, and Strings.

Referenced by C4PropList::GetSortedProperties().

574 {
575  // Return property list with descending into prototype
576  // But do not include Prototype property
577  std::vector< C4String * > result;
578  const C4PropList *p = this;
579  do
580  {
581  for (const C4Property *pp = p->Properties.First(); pp; pp = p->Properties.Next(pp))
582  if (pp->Key != &::Strings.P[P_Prototype])
583  if (!prefix || pp->Key->GetData().BeginsWith(prefix))
584  result.push_back(pp->Key);
585  p = p->GetPrototype();
586  if (p == ignore_parent) break;
587  } while (p);
588  return result;
589 }
C4String P[P_LAST]
T const * Next(T const *p) const
C4StringTable Strings
Definition: C4Globals.cpp:42
C4PropList * GetPrototype() const
Definition: C4PropList.h:83
T const * First() const

Here is the call graph for this function:

Here is the caller graph for this function:

int32_t C4Def::GetValue ( C4Object pInBase,
int32_t  iBuyPlayer 
)

Definition at line 615 of file C4Def.cpp.

References C4VNull, C4PropList::Call(), C4Value::getInt(), PSF_CalcBuyValue, PSF_CalcDefValue, and Value.

Referenced by C4Menu::DrawElement(), and C4Object::GetValue().

616 {
617  C4Value r = Call(PSF_CalcDefValue, &C4AulParSet(pInBase, iBuyPlayer));
618  int32_t iValue = Value;
619  if (r != C4VNull)
620  iValue = r.getInt();
621  // do any adjustments based on where the item is bought
622  if (pInBase)
623  {
624  r = pInBase->Call(PSF_CalcBuyValue, &C4AulParSet(this, iValue));
625  if (r != C4VNull)
626  iValue = r.getInt();
627  }
628  return iValue;
629 }
#define PSF_CalcBuyValue
Definition: C4GameScript.h:91
#define PSF_CalcDefValue
Definition: C4GameScript.h:81
int32_t Value
Definition: C4Def.h:117
int32_t getInt() const
Definition: C4Value.h:112
const C4Value C4VNull
Definition: C4Value.cpp:32
C4Value Call(C4PropertyName k, C4AulParSet *pPars=0, bool fPassErrors=false)
Definition: C4PropList.h:112

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4PropList::HasProperty ( C4String k) const
inlineinherited

Definition at line 120 of file C4PropList.h.

References C4Set< T >::Has().

Referenced by C4PropList::GetSortedLocalProperties(), C4MapScriptAlgo::GetXYProps(), C4AulCompiler::PreparseAstVisitor::visit(), and C4AulCompiler::ConstantResolver::visit().

120 { return Properties.Has(k); }
bool Has(H e) const

Here is the call graph for this function:

Here is the caller graph for this function:

void C4Def::IncludeDefinition ( C4Def pIncludeDef)

Definition at line 635 of file C4Def.cpp.

References fClonkNamesOwned, fRankNamesOwned, fRankSymbolsOwned, iNumRankSymbols, pClonkNames, pRankNames, and pRankSymbols.

Referenced by C4ScriptHost::Parse().

636 {
637  // inherited rank infos and clonk names, if this definition doesn't have its own
638  if (!fClonkNamesOwned) pClonkNames = pIncludeDef->pClonkNames;
639  if (!fRankNamesOwned) pRankNames = pIncludeDef->pRankNames;
640  if (!fRankSymbolsOwned) { pRankSymbols = pIncludeDef->pRankSymbols; iNumRankSymbols = pIncludeDef->iNumRankSymbols; }
641 }
int32_t iNumRankSymbols
Definition: C4Def.h:193
C4ComponentHost * pClonkNames
Definition: C4Def.h:188
bool fRankSymbolsOwned
Definition: C4Def.h:192
bool fRankNamesOwned
Definition: C4Def.h:191
C4FacetSurface * pRankSymbols
Definition: C4Def.h:192
C4RankSystem * pRankNames
Definition: C4Def.h:191
bool fClonkNamesOwned
Definition: C4Def.h:188

Here is the caller graph for this function:

bool C4PropList::IsFrozen ( ) const
inlineinherited

Definition at line 132 of file C4PropList.h.

132 { return constant; }
virtual bool C4PropList::IsNumbered ( ) const
inlinevirtualinherited

Reimplemented in C4PropListNumbered.

Definition at line 90 of file C4PropList.h.

Referenced by C4Value::Denumerate(), and C4PropList::operator==().

90 { return false; }

Here is the caller graph for this function:

const class C4PropListStatic* C4PropList::IsStatic ( ) const
inlineinherited

Definition at line 88 of file C4PropList.h.

References C4PropList::IsStatic().

Referenced by C4PropList::IsStatic().

88 { return const_cast<C4PropList*>(this)->IsStatic(); }
virtual class C4PropListStatic * IsStatic()
Definition: C4PropList.h:87

Here is the call graph for this function:

Here is the caller graph for this function:

virtual C4PropListStatic* C4PropListStatic::IsStatic ( )
inlinevirtualinherited

Reimplemented from C4PropList.

Definition at line 267 of file C4PropList.h.

Referenced by C4AulCompiler::ConstantResolver::visit().

267 { return this; }

Here is the caller graph for this function:

bool C4Def::Load ( C4Group hGroup,
StdMeshSkeletonLoader loader,
DWORD  dwLoadWhat,
const char *  szLanguage,
class C4SoundSystem pSoundSystem = nullptr,
C4DefGraphicsPtrBackup gfx_backup = nullptr 
)

Definition at line 106 of file c4def-handle.cpp.

References C4VPropList(), C4ScriptHost::Load(), C4PropListStatic::ParentKeyName, C4ScriptHost::Reg2List(), C4AulScriptEngine::RegisterGlobalConstant(), C4StringTable::RegString(), Script, ScriptEngine, and Strings.

Referenced by c4_mapgen_handle_set_map_library(), C4DefList::Load(), and C4DefList::Reload().

107 {
108  // Assume ID has been set already!
109 
110  // Register with script engine
111  ::ScriptEngine.RegisterGlobalConstant(id.ToString(), C4VPropList(this));
112  ParentKeyName = ::Strings.RegString(id.ToString());
114 
115  if(!Script.Load(hGroup, "Script.c", nullptr, nullptr))
116  {
117  return false;
118  }
119 
120  return true;
121 }
void RegisterGlobalConstant(const char *szName, const C4Value &rValue)
C4AulScriptEngine ScriptEngine
Definition: C4Globals.cpp:43
C4String * RegString(StdStrBuf String)
void Reg2List(C4AulScriptEngine *pEngine)
C4StringTable Strings
Definition: C4Globals.cpp:42
C4Value C4VPropList(C4PropList *p)
Definition: C4Value.h:245
C4DefScriptHost Script
Definition: C4Def.h:184
virtual bool Load(C4Group &hGroup, const char *szFilename, const char *szLanguage, C4LangStringTable *pLocalTable)
C4RefCntPointer< C4String > ParentKeyName
Definition: C4PropList.h:275

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4Def::LoadActMap ( C4Group hGroup)
protected
bool C4Def::LoadDefCore ( C4Group hGroup)

Definition at line 144 of file C4Def.cpp.

References C4CFN_DefCore, StdStrBuf::Clear(), Compile(), DebugLogF(), DirectorySeparator, FormatString(), StdStrBuf::getData(), C4Group::GetFullName(), C4PropListStatic::GetName(), C4Group::LoadEntryString(), and Mass.

Referenced by DefFileGetID().

145 {
146  StdStrBuf Source;
147  if (hGroup.LoadEntryString(C4CFN_DefCore,&Source))
148  {
149  StdStrBuf Name = hGroup.GetFullName() + (const StdStrBuf &)FormatString("%cDefCore.txt", DirectorySeparator);
150  if (!Compile(Source.getData(), Name.getData()))
151  return false;
152  Source.Clear();
153 
154  // Check mass
155  if (Mass < 0)
156  {
157  DebugLogF("WARNING: Def %s (%s) at %s has invalid mass!", GetName(), id.ToString(), hGroup.GetFullName().getData());
158  Mass = 0;
159  }
160 
161  return true;
162  }
163  return false;
164 }
const char * getData() const
Definition: StdBuf.h:450
#define C4CFN_DefCore
Definition: C4Components.h:46
virtual const char * GetName() const
Definition: C4PropList.cpp:267
bool Compile(const char *szSource, const char *szName)
Definition: C4Def.cpp:174
void Clear()
Definition: StdBuf.h:474
int32_t Mass
Definition: C4Def.h:116
bool DebugLogF(const char *strMessage...)
Definition: C4Log.cpp:281
StdStrBuf GetFullName() const
Definition: C4Group.cpp:2078
bool LoadEntryString(const char *szEntryName, StdStrBuf *Buf)
Definition: C4Group.cpp:1932
#define DirectorySeparator
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:277

Here is the call graph for this function:

Here is the caller graph for this function:

C4PropList * C4PropList::New ( C4PropList prototype = 0)
staticinherited

Definition at line 64 of file C4PropList.cpp.

Referenced by CompileNewFunc(), FnPlaceVegetation(), C4ScriptGuiWindowProperty::ToC4Value(), C4ScriptGuiWindow::ToC4Value(), and C4AulCompiler::ConstexprEvaluator::visit().

65 {
66  C4PropList * r = new C4PropListScript(prototype);
67  return r;
68 }

Here is the caller graph for this function:

C4PropListStatic * C4PropList::NewStatic ( C4PropList prototype,
const C4PropListStatic parent,
C4String key 
)
staticinherited

Definition at line 70 of file C4PropList.cpp.

Referenced by C4PropListScen::C4PropListScen(), C4ScriptHost::CopyPropList(), C4PropList::FreezeAndMakeStaticRecursively(), C4ScenarioParameterDefs::RegisterScriptConstants(), and C4AulCompiler::ConstexprEvaluator::visit().

71 {
72  return new C4PropListStatic(prototype, parent, key);
73 }

Here is the caller graph for this function:

bool C4PropList::operator== ( const C4PropList b) const
inherited

Definition at line 358 of file C4PropList.cpp.

References C4Set< T >::First(), C4Set< T >::Get(), C4PropList::GetDef(), C4Set< T >::GetSize(), C4PropList::IsNumbered(), C4Property::Key, C4Set< T >::Next(), and C4Property::Value.

359 {
360  // every numbered proplist has a unique number and is only identical to itself
361  if (this == &b) return true;
362  if (IsNumbered() || b.IsNumbered()) return false;
363  if (Properties.GetSize() != b.Properties.GetSize()) return false;
364  if (GetDef() != b.GetDef()) return false;
365  const C4Property * p = Properties.First();
366  while (p)
367  {
368  const C4Property & bp = b.Properties.Get(p->Key);
369  if (!bp) return false;
370  if (p->Value != bp.Value) return false;
371  p = Properties.Next(p);
372  }
373  return true;
374 }
C4Value Value
Definition: C4PropList.h:57
virtual C4Def const * GetDef() const
Definition: C4PropList.cpp:640
T & Get(H e) const
T const * Next(T const *p) const
unsigned int GetSize() const
C4String * Key
Definition: C4PropList.h:56
virtual bool IsNumbered() const
Definition: C4PropList.h:90
T const * First() const

Here is the call graph for this function:

void C4PropListStatic::RefCompileFunc ( StdCompiler pComp,
C4ValueNumbers numbers 
) const
inherited

Definition at line 240 of file C4PropList.cpp.

References StdCompiler::excCorrupt(), C4String::GetData(), StdCompiler::isDeserializer(), mkParAdapt(), C4PropListStatic::Parent, C4PropListStatic::ParentKeyName, StdCompiler::RCT_ID, C4PropListStatic::RefCompileFunc(), StdCompiler::SEP_PART, StdCompiler::Separator(), and StdCompiler::Value().

Referenced by C4Effect::CompileFunc(), C4Value::CompileFunc(), and C4PropListStatic::RefCompileFunc().

241 {
242  assert(!pComp->isDeserializer());
243  if (Parent)
244  {
245  Parent->RefCompileFunc(pComp, numbers);
247  }
248  if (!ParentKeyName)
249  pComp->excCorrupt("C4PropListStatic::RefCompileFunc without ParentKeyName");
251 }
virtual bool Separator(Sep eSep=SEP_SEP)
Definition: StdCompiler.h:129
StdStrBuf GetData() const
Definition: C4StringTable.h:50
void excCorrupt(const char *szMessage,...)
Definition: StdCompiler.h:258
void RefCompileFunc(StdCompiler *pComp, C4ValueNumbers *numbers) const
Definition: C4PropList.cpp:240
const C4PropListStatic * Parent
Definition: C4PropList.h:274
void Value(const T &rStruct)
Definition: StdCompiler.h:170
virtual bool isDeserializer()
Definition: StdCompiler.h:63
StdParameterAdapt< T, P > mkParAdapt(T &&rObj, P &&rPar)
Definition: StdAdaptors.h:456
C4RefCntPointer< C4String > ParentKeyName
Definition: C4PropList.h:275

Here is the call graph for this function:

Here is the caller graph for this function:

void C4PropList::RemoveCyclicPrototypes ( )
inherited

Definition at line 409 of file C4PropList.cpp.

References C4Value::getPropList(), and C4Value::Set0().

Referenced by C4PropList::Denumerate().

410 {
411  // clear any cyclic prototype chains
412  // Use prototype.getPropList() instead of GetPrototype() because denumeration might not be completed yet
413  for(C4PropList * it = prototype.getPropList(); it; it = it->prototype.getPropList())
414  if(it == this)
415  {
416  prototype.Set0();
417  }
418 }
void Set0()
Definition: C4Value.h:336
C4PropList * getPropList() const
Definition: C4Value.h:116

Here is the call graph for this function:

Here is the caller graph for this function:

void C4Def::ResetIncludeDependencies ( )

Definition at line 643 of file C4Def.cpp.

References fClonkNamesOwned, fRankNamesOwned, fRankSymbolsOwned, iNumRankSymbols, pRankNames, and pRankSymbols.

644 {
645  // clear all pointers into foreign defs
646  if (!fClonkNamesOwned) pClonkNames = nullptr;
647  if (!fRankNamesOwned) pRankNames = nullptr;
648  if (!fRankSymbolsOwned) { pRankSymbols = nullptr; iNumRankSymbols = 0; }
649 }
int32_t iNumRankSymbols
Definition: C4Def.h:193
C4ComponentHost * pClonkNames
Definition: C4Def.h:188
bool fRankSymbolsOwned
Definition: C4Def.h:192
bool fRankNamesOwned
Definition: C4Def.h:191
C4FacetSurface * pRankSymbols
Definition: C4Def.h:192
C4RankSystem * pRankNames
Definition: C4Def.h:191
bool fClonkNamesOwned
Definition: C4Def.h:188
void C4PropList::ResetProperty ( C4String k)
virtualinherited

Reimplemented in C4Object, and C4Effect.

Definition at line 928 of file C4PropList.cpp.

References C4StringTable::P, P_Prototype, C4Set< T >::Remove(), C4Value::Set0(), and Strings.

Referenced by C4Effect::ResetProperty(), C4Object::ResetProperty(), C4PropList::SetName(), and C4ScriptHost::UnlinkOwnedFunctions().

929 {
930  if (k == &Strings.P[P_Prototype])
931  prototype.Set0();
932  else
933  Properties.Remove(k);
934 }
C4String P[P_LAST]
void Set0()
Definition: C4Value.h:336
C4StringTable Strings
Definition: C4Globals.cpp:42
void Remove(H e)

Here is the call graph for this function:

Here is the caller graph for this function:

bool C4Def::Save ( C4Group hGroup)

Definition at line 166 of file C4Def.cpp.

References C4Group::Add(), C4CFN_DefCore, Decompile(), and FormatString().

167 {
168  StdStrBuf Out;
169  if (! Decompile(&Out, FormatString("%s::DefCore.txt", id.ToString()).getData()) )
170  return false;
171  return hGroup.Add(C4CFN_DefCore,Out,false,true);
172 }
#define C4CFN_DefCore
Definition: C4Components.h:46
bool Decompile(StdStrBuf *pOut, const char *szName)
Definition: C4Def.cpp:179
bool Add(const char *szFile, const char *szAddAs)
Definition: C4Group.cpp:1316
StdStrBuf FormatString(const char *szFmt,...)
Definition: StdBuf.cpp:277

Here is the call graph for this function:

void C4PropList::SetName ( const char *  NewName = 0)
virtualinherited

Reimplemented in C4Object.

Definition at line 611 of file C4PropList.cpp.

References C4VString(), C4StringTable::P, P_Name, C4PropList::ResetProperty(), C4PropList::SetProperty(), and Strings.

Referenced by c4_mapgen_handle_set_map_library(), C4MapScriptHost::InitFunctionMap(), and C4Object::SetName().

612 {
613  if (!NewName)
615  else
616  {
617  SetProperty(P_Name, C4VString(NewName));
618  }
619 }
virtual void ResetProperty(C4String *k)
Definition: C4PropList.cpp:928
C4String P[P_LAST]
void SetProperty(C4PropertyName k, const C4Value &to)
Definition: C4PropList.h:122
C4StringTable Strings
Definition: C4Globals.cpp:42
C4Value C4VString(C4String *pStr)
Definition: C4Value.h:246

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void C4PropList::SetOnFire ( bool  OnFire)
inlinevirtualinherited

Reimplemented in C4Object.

Definition at line 71 of file C4PropList.h.

Referenced by C4Effect::ClearAll(), C4Effect::Init(), C4Effect::Kill(), C4Effect::TempReaddUpperEffects(), and C4Effect::TempRemoveUpperEffects().

71 { }

Here is the caller graph for this function:

void C4PropList::SetProperty ( C4PropertyName  k,
const C4Value to 
)
inlineinherited

Definition at line 122 of file C4PropList.h.

References C4StringTable::P, C4PropList::SetPropertyByS(), and Strings.

Referenced by C4Effect::C4Effect(), C4Object::ChangeDef(), C4Object::Init(), C4DefScriptHost::Parse(), C4ScriptHost::Preparse(), C4Object::SetAction(), C4PropList::SetName(), C4ScriptGuiWindow::ToC4Value(), C4ScriptHost::UnLink(), and C4MapScriptLayer::UpdateSurfaceSize().

123  { SetPropertyByS(&Strings.P[k], to); }
C4String P[P_LAST]
C4StringTable Strings
Definition: C4Globals.cpp:42
virtual void SetPropertyByS(C4String *k, const C4Value &to)
Definition: C4PropList.cpp:907

Here is the call graph for this function:

Here is the caller graph for this function:

void C4PropList::SetPropertyByS ( C4String k,
const C4Value to 
)
virtualinherited

Reimplemented in C4Object, C4PropListScen, and C4Effect.

Definition at line 907 of file C4PropList.cpp.

References C4Set< T >::Add(), C4Set< T >::Get(), C4Value::getPropList(), C4PropList::GetPrototype(), C4Set< T >::Has(), C4StringTable::P, P_Prototype, C4Value::SetPropList(), Strings, and C4Property::Value.

Referenced by C4AulDefFunc::C4AulDefFunc(), C4PropListScen::C4PropListScen(), C4ScriptHost::CopyPropList(), C4PropList::SetProperty(), C4Effect::SetPropertyByS(), C4PropListScen::SetPropertyByS(), C4Object::SetPropertyByS(), C4ScriptGuiWindowProperty::ToC4Value(), C4ScriptGuiWindow::ToC4Value(), C4ScriptHost::UnlinkOwnedFunctions(), C4AulCompiler::PreparseAstVisitor::visit(), C4AulCompiler::ConstexprEvaluator::visit(), and C4AulCompiler::ConstantResolver::visit().

908 {
909  assert(!constant);
910  if (k == &Strings.P[P_Prototype])
911  {
912  C4PropList * newpt = to.getPropList();
913  for(C4PropList * it = newpt; it; it = it->GetPrototype())
914  if(it == this)
915  throw C4AulExecError("Trying to create cyclic prototype structure");
916  prototype.SetPropList(newpt);
917  }
918  else if (Properties.Has(k))
919  {
920  Properties.Get(k).Value = to;
921  }
922  else
923  {
924  Properties.Add(C4Property(k, to));
925  }
926 }
C4String P[P_LAST]
C4Value Value
Definition: C4PropList.h:57
T * Add(T const &e)
bool Has(H e) const
T & Get(H e) const
C4StringTable Strings
Definition: C4Globals.cpp:42
C4PropList * GetPrototype() const
Definition: C4PropList.h:83
void SetPropList(C4PropList *PropList)
Definition: C4Value.h:141
C4PropList * getPropList() const
Definition: C4Value.h:116

Here is the call graph for this function:

Here is the caller graph for this function:

void C4Def::Synchronize ( )

Definition at line 631 of file C4Def.cpp.

632 {
633 }
void C4PropList::Thaw ( )
inlineinherited

Definition at line 131 of file C4PropList.h.

Referenced by C4AulScriptEngine::UnLink(), and C4ScriptHost::UnlinkOwnedFunctions().

131 { constant = false; }

Here is the caller graph for this function:

StdStrBuf C4PropList::ToJSON ( int  depth = 10,
bool  ignore_reference_parent = false 
) const
inherited

Definition at line 515 of file C4PropList.cpp.

References StdStrBuf::Append(), C4PropList::C4Value, C4Set< T >::GetSize(), C4Set< T >::GetSortedListOfElementPointers(), and C4PropList::IsStatic().

Referenced by C4Value::ToJSON().

516 {
517  if (depth <= 0 && Properties.GetSize())
518  {
519  throw new C4JSONSerializationError("maximum depth reached");
520  }
521  StdStrBuf DataString;
522  DataString = "{";
523  std::list<const C4Property *> sorted_props = Properties.GetSortedListOfElementPointers();
524  for (std::list<const C4Property *>::const_iterator p = sorted_props.begin(); p != sorted_props.end(); ++p)
525  {
526  if (p != sorted_props.begin()) DataString.Append(",");
527  DataString.Append(C4Value((*p)->Key).ToJSON());
528  DataString.Append(":");
529  DataString.Append((*p)->Value.ToJSON(depth - 1, ignore_reference_parent ? IsStatic() : nullptr));
530  }
531  DataString.Append("}");
532  return DataString;
533 }
std::list< const T * > GetSortedListOfElementPointers() const
friend class C4Value
Definition: C4PropList.h:166
virtual class C4PropListStatic * IsStatic()
Definition: C4PropList.h:87
unsigned int GetSize() const
void Append(const char *pnData, size_t iChars)
Definition: StdBuf.h:527

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class C4DefList
friend

Definition at line 174 of file C4Def.h.

Member Data Documentation

int32_t C4Def::AllowPictureStack

Definition at line 150 of file C4Def.h.

Referenced by C4Object::CanConcatPictureWith(), and CompileFunc().

int32_t C4Def::AttractLightning

Definition at line 131 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), and C4Object::SetOCF().

int32_t C4Def::BlitMode
C4ID C4Def::BurnTurnTo

Definition at line 112 of file C4Def.h.

Referenced by DefaultDefCore().

int32_t C4Def::ClosedContainer

Definition at line 141 of file C4Def.h.

Referenced by CompileFunc(), and DefaultDefCore().

int32_t C4Def::ColorByOwner
int32_t C4Def::ConSizeOff

Definition at line 146 of file C4Def.h.

Referenced by CompileFunc(), ConstructionCheck(), and DefaultDefCore().

StdCopyStrBuf C4Def::ConsoleGroupPath

Definition at line 180 of file C4Def.h.

int32_t C4Def::Constructable
int32_t C4Def::Creation

Definition at line 181 of file C4Def.h.

Referenced by Default().

int32_t C4Def::CrewMember
int32_t C4Def::Exclusive

Definition at line 118 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), and C4Object::SetOCF().

bool C4Def::fClonkNamesOwned

Definition at line 188 of file C4Def.h.

Referenced by Clear(), Default(), IncludeDefinition(), and ResetIncludeDependencies().

char C4Def::Filename[_MAX_FNAME+1]
int32_t C4Def::Float
int32_t C4Def::Fragile

Definition at line 133 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), and C4Command::Put().

bool C4Def::fRankNamesOwned

Definition at line 191 of file C4Def.h.

Referenced by Clear(), Default(), IncludeDefinition(), and ResetIncludeDependencies().

bool C4Def::fRankSymbolsOwned

Definition at line 192 of file C4Def.h.

Referenced by Clear(), Default(), IncludeDefinition(), and ResetIncludeDependencies().

bool C4Def::HideInCreator

Definition at line 151 of file C4Def.h.

Referenced by CompileFunc(), and DefaultDefCore().

int32_t C4Def::IncompleteActivity
int32_t C4Def::iNumRankSymbols
int32_t C4Def::LiftTop

Definition at line 125 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), and C4Object::ExecAction().

int32_t C4Def::Line

Definition at line 128 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), C4Object::Draw(), and C4Object::UpdateShape().

int32_t C4Def::LineIntersect

Definition at line 129 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), and C4Object::ExecAction().

C4Facet C4Def::MainFace
protected

Definition at line 198 of file C4Def.h.

Referenced by Default(), and GetMainFace().

int32_t C4Def::Mass
int32_t C4Def::MoveToRange
int32_t C4Def::NativeCrew

Definition at line 115 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), and C4ObjectInfoList::GetIdle().

int32_t C4Def::NoBreath

Definition at line 145 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), and C4Object::ExecLife().

int32_t C4Def::NoGet
int32_t C4Def::NoHorizontalMove

Definition at line 124 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), C4Object::DoMovement(), and C4Object::Push().

int32_t C4Def::NoMassFromContents

Definition at line 139 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), and C4Object::UpdateMass().

int32_t C4Def::NoPushEnter

Definition at line 135 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), and C4Command::Enter().

int32_t C4Def::NoStabilize

Definition at line 140 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), and C4Object::Stabilize().

int32_t C4Def::NoTransferZones

Definition at line 149 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), and C4Command::MoveTo().

int32_t C4Def::Oversize

Definition at line 132 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), C4Object::DoCon(), and C4EditCursor::Move().

const C4PropListStatic* C4PropListStatic::Parent
protectedinherited
int32_t C4Def::Pathfinder
C4ComponentHost* C4Def::pClonkNames

Definition at line 188 of file C4Def.h.

Referenced by Clear(), Default(), IncludeDefinition(), and C4ObjectInfoList::New().

int32_t C4Def::Projectile

Definition at line 134 of file C4Def.h.

Referenced by C4Command::Attack(), CompileFunc(), and DefaultDefCore().

int32_t C4Def::rC4XVer[2]

Definition at line 104 of file C4Def.h.

Referenced by C4DefList::CheckEngineVersion(), CompileFunc(), and DefaultDefCore().

C4IDList C4Def::RequireDef

Definition at line 105 of file C4Def.h.

Referenced by C4DefList::CheckRequireDef(), CompileFunc(), and DefaultDefCore().

int32_t C4Def::RotatedEntrance

Definition at line 148 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), C4Object::SetOCF(), and C4Object::UpdateOCF().

int32_t C4Def::SilentCommands

Definition at line 142 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), and C4Command::Fail().

C4TargetRect C4Def::SolidMask
int32_t C4PropList::Status
inherited

Definition at line 169 of file C4PropList.h.

Referenced by C4Command::Acquire(), C4Command::Activate(), C4GameObjects::Add(), C4ObjectList::Add(), C4FoW::Add(), C4EditCursor::AddToSelection(), C4Object::AssignDeath(), C4ObjectList::AssignInfo(), C4Object::AssignRemoval(), C4Object::At(), C4PropList::Call(), C4Game::CastObjects(), C4ObjectList::CheckCategorySort(), C4ObjectList::CheckSort(), C4Effect::ClearAll(), C4ObjectList::ClearInfo(), C4Object::Collect(), C4Object::CompileFunc(), C4GameObjects::CrossCheck(), C4ObjectList::DeleteObjects(), C4ObjectList::Denumerate(), C4Landscape::P::DigMaterial2Objects(), C4Object::DirectComContents(), C4Effect::DoDamage(), C4Object::Draw(), C4Game::DrawCrewOverheadText(), C4Object::DrawSelectMark(), C4Object::DrawTopFace(), C4EditCursor::EMMoveObject(), C4Object::Enter(), C4Object::ExecAction(), C4SoundInstance::Execute(), C4Effect::Execute(), C4Object::Execute(), C4ScriptGuiWindowAction::ExecuteCommand(), C4Command::Fail(), C4FindObject::Find(), C4ObjectList::Find(), C4ObjectList::FindOther(), C4GameObjects::FixObjectOrder(), C4PropList::FreezeAndMakeStaticRecursively(), C4Object::GetArea(), C4EditCursor::GetCurrentSelectionPosition(), C4Object::GetEntranceArea(), C4Object::GetInfoString(), C4ObjectList::GetListID(), C4Object::GetMomentum(), C4ObjectList::GetObject(), C4Object::GrabInfo(), GrabLost(), C4GameObjects::GRBroadcast(), C4GameMessage::Init(), C4Effect::Init(), C4Object::IsMoveableBySolidMask(), C4GraphicsOverlay::IsValid(), C4Object::Lift(), C4ObjectList::ListIDCount(), C4Player::MakeCrewMember(), C4ObjectList::MassCount(), C4Object::MenuCommand(), C4GameMessageList::New(), C4Game::NewObject(), ObjectComGrab(), ObjectComUnGrab(), C4ObjectList::ObjectCount(), C4EditCursor::PerformDuplicationLegacy(), C4Landscape::P::PostFreeShape(), C4GameObjects::PostLoad(), C4Object::Push(), C4GameObjects::Remove(), C4EditCursor::RemoveFromSelection(), C4AulScriptContext::ReturnDump(), C4GameObjects::SafeObjectPointer(), C4Object::SetAction(), C4Object::SetGraphics(), C4GameObjects::SetOCF(), C4Object::SetOCF(), C4Object::StatusActivate(), C4Object::StatusDeactivate(), C4Effect::TempReaddUpperEffects(), C4Effect::TempRemoveUpperEffects(), C4ObjectList::UpdateFaces(), C4ObjectList::UpdateGraphics(), C4Object::UpdateOCF(), C4Object::UpdatePos(), C4Object::UpdateSolidMask(), C4GameObjects::UpdateSolidMasks(), C4ObjectList::ValidateOwners(), and C4ObjectList::Write().

C4LangStringTable C4Def::StringTable

Definition at line 185 of file C4Def.h.

Referenced by Clear(), and Default().

bool C4Def::Temporary
protected

Definition at line 202 of file C4Def.h.

Referenced by Default(), and C4DefList::RemoveTemporary().

int32_t C4Def::TemporaryCrew

Definition at line 143 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), and C4ObjectInfoList::Save().

C4TargetRect C4Def::TopFace

Definition at line 111 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), C4Object::DrawTopFace(), and C4Object::UpdateFace().

int32_t C4Def::UprightAttach

Definition at line 127 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), and C4Object::ExecAction().

int32_t C4Def::Value

Definition at line 117 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), GetValue(), and C4Game::InitValueOverloads().

int32_t C4Def::VehicleControl

Definition at line 136 of file C4Def.h.

Referenced by CompileFunc(), DefaultDefCore(), and C4Object::SetCommand().


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