rj-action-library/Runtime/Godot/Scenes/Objects/SceneFileObject.cs

38 lines
873 B
C#
Raw Permalink Normal View History

2024-07-25 05:40:31 +00:00
using Godot;
using System.Collections.Generic;
namespace Rokojori
{
public class SceneFileObject
{
protected SceneFileEntry _headerEntry;
protected List<SceneFileHeaderAttributeValue> _attributes = new List<SceneFileHeaderAttributeValue>();
public SceneFileObject()
{
SetAttributes();
}
public void CreateFromHeaderEntry( SceneFileEntry headerEntry )
{
ReadAttributes( headerEntry.header );
_CreateFromHeaderEntry( headerEntry);
}
protected virtual void _CreateFromHeaderEntry( SceneFileEntry headerEntry )
{
}
protected virtual void SetAttributes()
{
2024-11-12 08:03:36 +00:00
_attributes = ReflectionHelper.GetFieldValuesOfType<SceneFileHeaderAttributeValue>( this );
2024-07-25 05:40:31 +00:00
}
protected void ReadAttributes( SceneFileHeader entry )
{
_attributes.ForEach( a => a.GetValue( entry ) );
}
}
}