1 // Copyright 2001-2019 Crytek GmbH / Crytek Group. All rights reserved.
4 #include "Script/Elements/ScriptGroup.h"
6 #include <CrySerialization/IArchiveHost.h>
7 #include <CrySchematyc2/GUIDRemapper.h>
8 #include <CrySchematyc2/Serialization/ISerializationContext.h>
12 //////////////////////////////////////////////////////////////////////////
13 CScriptGroup::CScriptGroup(IScriptFile
& file
, const SGUID
& guid
, const SGUID
& scopeGUID
, const char* szName
)
14 : CScriptElementBase(EScriptElementType::Group
, file
)
16 , m_scopeGUID(scopeGUID
)
20 //////////////////////////////////////////////////////////////////////////
21 EAccessor
CScriptGroup::GetAccessor() const
23 return EAccessor::Private
;
26 //////////////////////////////////////////////////////////////////////////
27 SGUID
CScriptGroup::GetGUID() const
32 //////////////////////////////////////////////////////////////////////////
33 SGUID
CScriptGroup::GetScopeGUID() const
38 //////////////////////////////////////////////////////////////////////////
39 bool CScriptGroup::SetName(const char* szName
)
45 //////////////////////////////////////////////////////////////////////////
46 const char* CScriptGroup::GetName() const
48 return m_name
.c_str();
51 //////////////////////////////////////////////////////////////////////////
52 void CScriptGroup::EnumerateDependencies(const ScriptDependancyEnumerator
& enumerator
) const {}
54 //////////////////////////////////////////////////////////////////////////
55 void CScriptGroup::Refresh(const SScriptRefreshParams
& params
) {}
57 //////////////////////////////////////////////////////////////////////////
58 void CScriptGroup::Serialize(Serialization::IArchive
& archive
)
60 CRY_PROFILE_FUNCTION(PROFILE_LOADING_ONLY
);
62 CScriptElementBase::Serialize(archive
);
64 SerializationContext::SetValidatorLink(archive
, SValidatorLink(m_guid
)); // #SchematycTODO : Can we set this from CScriptElementBase?
65 switch(SerializationContext::GetPass(archive
))
67 case ESerializationPass::PreLoad
:
68 case ESerializationPass::Save
:
70 archive(m_guid
, "guid");
71 archive(m_scopeGUID
, "scope_guid");
72 archive(m_name
, "name");
78 //////////////////////////////////////////////////////////////////////////
79 void CScriptGroup::RemapGUIDs(IGUIDRemapper
& guidRemapper
)
81 m_guid
= guidRemapper
.Remap(m_guid
);
82 m_scopeGUID
= guidRemapper
.Remap(m_scopeGUID
);