38 lines
868 B
C#
38 lines
868 B
C#
|
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()
|
||
|
{
|
||
|
_attributes = ReflectionHelper.GetFieldsOfType<SceneFileHeaderAttributeValue>( this );
|
||
|
}
|
||
|
|
||
|
protected void ReadAttributes( SceneFileHeader entry )
|
||
|
{
|
||
|
_attributes.ForEach( a => a.GetValue( entry ) );
|
||
|
}
|
||
|
}
|
||
|
}
|