Exemple #1
0
    public string jsonEncode()
    {
        string j;

        j = "\"bridgeObjId\": " + bridgeObjId.ToString() + "," +
            "\"bridgeCenterLength\": " + bridgeCenterLength.ToString() + "," +
            "\"targetRoom\": " + (targetRoom != null?targetRoom.jsonEncode():"\"\"") + ",";
        j = "{" + j.TrimEnd(',') + "}";
        return(j);
    }
Exemple #2
0
    //public List<GenEvent> events;

    public string jsonEncode()
    {
//      string jEvents = "";
//      if(events != null) {
//          foreach(GenEvent e in events) {
//              jEvents += e.jsonEncode() + ",";
//          }
//      }

        string j;

        j = "\"levelId\": " + levelId.ToString() + "," +
            "\"startingRoom\": " + (startingRoom != null ? startingRoom.jsonEncode() : "\"\"") + "," +
            (bossRoom != null ? "\"bossRoom\": " + bossRoom.jsonEncode() + "," : "") +
            ",";
        //"\"events\": [" + jEvents.TrimEnd(',') + "],";
        j = "{" + j.TrimEnd(',') + "}";
        return(j);
    }