Added research display to the game
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using Godot;
|
||||
|
||||
public class ResearchData
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public string Id { get; set; }
|
||||
|
||||
[JsonPropertyName("inputs")]
|
||||
public List<Ingredient> Inputs { get; set; }
|
||||
|
||||
[JsonPropertyName("research")]
|
||||
public string Research { get; set; }
|
||||
|
||||
[JsonPropertyName("crafttime")]
|
||||
public double CraftTime { get; set; }
|
||||
|
||||
[JsonPropertyName("texture")]
|
||||
public string Texture { get; set; }
|
||||
|
||||
public string GetReadableName()
|
||||
{
|
||||
string noUnderscore = Id.Replace("_", " ").ToLower();
|
||||
return char.ToUpper(noUnderscore[0]) + noUnderscore.Substring(1);
|
||||
}
|
||||
|
||||
public static string GetIndex(string readable)
|
||||
{
|
||||
return readable.ToLower().Replace(" ", "_");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user