コード例 #1
0
 public virtual string ToJson()
 {
     return("{" +
            "\"id\" : " + "\"" + Id + "\", " +
            "\"name\" : " + "\"" + Name + "\", " +
            "\"power\" : " + Power + ", " +
            "\"weight\" : " + Weight + ", " +
            "\"innate\" : " + Innate.ToJson() + ", " +
            "\"blessing\" : " + Blessing.ToJson() + "}");
 }
コード例 #2
0
 public InventoryItem(string name, string id = null,
                      int power     = 0, int weight = 0,
                      Innate innate = null, Blessing blessing = null)
 {
     Name     = name;
     Id       = id ?? Guid.NewGuid().ToString();
     Power    = power;
     Weight   = weight;
     Innate   = innate ?? new Innate();
     Blessing = blessing ?? new Blessing();
 }