SaveField() public static method

public static SaveField ( object o, string field ) : MiniYamlNode
o object
field string
return MiniYamlNode
Beispiel #1
0
        public MiniYaml Save(TileSet tileSet)
        {
            var root = new List <MiniYamlNode>();

            if (Height != 0)
            {
                root.Add(FieldSaver.SaveField(this, "Height"));
            }

            if (RampType != 0)
            {
                root.Add(FieldSaver.SaveField(this, "RampType"));
            }

            if (LeftColor != tileSet.TerrainInfo[TerrainType].Color)
            {
                root.Add(FieldSaver.SaveField(this, "LeftColor"));
            }

            if (RightColor != tileSet.TerrainInfo[TerrainType].Color)
            {
                root.Add(FieldSaver.SaveField(this, "RightColor"));
            }

            return(new MiniYaml(tileSet.TerrainInfo[TerrainType].Type, root));
        }