public override TydNode DeepClone() { TydTable c = new TydTable(name, Parent, docLine); CopyDataFrom(c); return(c); }
public override TydNode DeepClone() { var c = new TydTable(_name, DocLine); CopyDataFrom(c); return(c); }
public static BBInputProfile FromTydTable(TydTable table) { var profile = new BBInputProfile(); profile.Axes = new List <BBInputAxis>(); profile.Name = table.Name; profile.Enabled = false; InGameDebug.Log("Loading new BBInputProfile..."); foreach (var node in table.Nodes) { if (node.Name.ToLowerInvariant() == "enabled") { profile.Enabled = bool.Parse((node as TydString).Value); } else if (node.Name.ToLowerInvariant() == "alwaysenabled") { profile.AlwaysEnabled = bool.Parse((node as TydString).Value); } else if (node.Name.ToLowerInvariant() == "name") { profile.Name = (node as TydString).Value; } else if (node.Name.ToLowerInvariant() == "axes") { foreach (var axisNodes in (node as TydCollection).Nodes) { profile.Axes.Add(BBInputAxis.FromTydTable(axisNodes as TydTable)); } } } profile.Axes.Sort((x, y) => y.Priority - x.Priority); InGameDebug.Log("Loaded BBInputProfile: " + profile.Name); return(profile); }
public static CharacterType FromTydTable(TydTable table) { var type = new CharacterType(); foreach (var node in table.Nodes) { switch (node.Name) { case "symbol": type.Symbol = (node as TydString).Value; break; case "fullName": type.FullName = (node as TydString).Value; break; } } return(type); }
public void ReadData(TydTable data) { // Get id Id = GetTydString(data, "id").IntValue; // Get tag Tag = GetTydString(data, "tag").Value; // Get Name Name = GetTydString(data, "name").Value; // Get back tile flag BackTile = GetTydString(data, "backTile").BoolValue; // Get transparent flag Transparent = GetTydString(data, "transparent").BoolValue; // Get solid flag Solid = GetTydString(data, "solid").BoolValue; // Get climbable flag Climbable = GetTydString(data, "climbable").BoolValue; // Get mineable flag Mineable = GetTydString(data, "mineable").BoolValue; }
private TydString GetTydString(TydTable tydTable, string name) { return(tydTable[name] as TydString); }