当前位置: 首页>>代码示例>>C#>>正文


C# SimpleJSON.JSONNode类代码示例

本文整理汇总了C#中SimpleJSON.JSONNode的典型用法代码示例。如果您正苦于以下问题:C# JSONNode类的具体用法?C# JSONNode怎么用?C# JSONNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


JSONNode类属于SimpleJSON命名空间,在下文中一共展示了JSONNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Parse

 public IParseble Parse(JSONNode rootNode)
 {
     IsInvoiceCreated 	= rootNode ["invoice_created"].AsBool;
     OperationId 		= rootNode ["operation_id"].AsInt;
     Error 				= rootNode ["errors"].AsArray [0] ["message"];
     return this;
 }
开发者ID:xsolla,项目名称:xsolla-unity-sdk,代码行数:7,代码来源:XProceed.cs

示例2: Parse

 public IParseble Parse(JSONNode buyDataNode)
 {
     if (buyDataNode ["currency"] != null)
         currency = buyDataNode ["currency"];
     if (buyDataNode ["sum"] != null)
         sum = buyDataNode ["sum"];
     if (buyDataNode ["enabled"] != null)
         enabled = buyDataNode ["enabled"].AsBool;
     if (buyDataNode ["example"] != null)
         example = buyDataNode ["example"];
     if (buyDataNode ["isMandatory"] != null)
         isMandatory = buyDataNode ["isMandatory"];
     if (buyDataNode ["isPakets"] != null)
         isPakets = buyDataNode ["isPakets"];
     if (buyDataNode ["isReadonly"] != null)
         isReadonly = buyDataNode ["isReadonly"];
     if (buyDataNode ["isVisible"] != null)
         isVisible = buyDataNode ["isVisible"];
     if (buyDataNode ["name"] != null)
         name = buyDataNode ["name"];
     if (buyDataNode ["options"] != null)
         options = buyDataNode ["options"];
     if (buyDataNode ["title"] != null)
         title = buyDataNode ["title"];
     if (buyDataNode ["tooltip"] != null)
         tooltip = buyDataNode ["tooltip"];
     if (buyDataNode ["type"] != null)
         type = buyDataNode ["type"];
     if (buyDataNode ["value"] != null)
         value = buyDataNode ["value"];
     return this;
 }
开发者ID:xsolla,项目名称:xsolla-unity-sdk,代码行数:32,代码来源:BuyData.cs

示例3: createLayers

        //  create all layers
        private List<Layer> createLayers(JSONNode json)
        {
            List<Layer> layers = new List<Layer>();

            foreach (JSONNode layerNode in json.AsArray) {
                Layer layer = new Layer();
                layer.Name = layerNode["name"];
                layer.Height = layerNode["properties"]["Height"].AsInt;

                Vector3 rotation = Vector3.zero;

                if (layerNode["properties"]["Rotation-x"].Value != null) {
                    rotation.x = layerNode["properties"]["Rotation-x"].AsFloat;
                }

                if (layerNode["properties"]["Rotation-y"].Value != null) {
                    rotation.y = layerNode["properties"]["Rotation-y"].AsFloat;
                }

                if (layerNode["properties"]["Rotation-z"].Value != null) {
                    rotation.z = layerNode["properties"]["Rotation-z"].AsFloat;
                }

                layer.Rotation = Quaternion.Euler(rotation);

                foreach (JSONNode dataNode in layerNode["data"].AsArray) {
                    layer.Data.Add(dataNode.AsInt);
                }

                layers.Add(layer);
            }

            return layers;
        }
开发者ID:adampassey,项目名称:Unity-Tiled-Importer,代码行数:35,代码来源:JSONMapParser.cs

示例4: ParseJson

 public override void ParseJson(JSONNode json)
 {
     Size = json["size"].AsFloat;
     Shift = json["shift"].AsFloat;
     Direction = (Direction)Enum.Parse(typeof(Direction), json["direction"].ToString().Replace("\"", ""));
     Pivot = (Pivot)Enum.Parse(typeof(Pivot), json["pivot"].ToString().Replace("\"", ""));
 }
开发者ID:arahis,项目名称:LinesClient,代码行数:7,代码来源:LinesStructure.cs

示例5: FromJSON

 public override void FromJSON(Tile tile, JSONNode node)
 {
     tile.position.x = node ["x"].AsInt;
     tile.position.y = node ["y"].AsInt;
     tile.text = node ["text"];
     tile.color = Util.Color.HexToColor (node["color"]);
 }
开发者ID:ChoiIngon,项目名称:Rpg1994,代码行数:7,代码来源:Tree.cs

示例6: checkBindings

        public static RfidBinding checkBindings(JSONNode JSONatt, touchType smartTouchType)
        {
            //Debug.LogError ("Checking rfid bindings that contains attributes...");
            RfidBinding rfidObject = null;
            for (int i = 0; i < bindedObjects.Count; i++) {
                RfidBinding temp = bindedObjects [i];
                for (int k = 0; k<JSONatt.Count; k++) {
                    string tempAttribute = JSONatt [k].Value;
                    if (temp.attribute.Contains (tempAttribute)) {
                        i = bindedObjects.Count;
                        k = JSONatt.Count;
                        //Debug.LogError ("Attributes found!...'" + tempAttribute + "', checking if binding is enabled and functions exists!");
                        if(temp.enableBinding &&
                            ((smartTouchType == touchType.smartTouchStart && temp.smartTouchStart != null) ||
                         (smartTouchType == touchType.smartTouchEnd && temp.smartTouchEnd != null))){
                            rfidObject = temp;
                        }

                    } else {
                        //Debug.LogError ("No bindings exists with attributes, " + tempAttribute);
                        rfidObject = null; //object exits, but not enabled or does not contain executable function
                    }
                }
            }
            return rfidObject;
        }
开发者ID:prizm-labs,项目名称:PrizmStarterKit_01,代码行数:26,代码来源:Prizm.cs

示例7: make

        public static BaseRule<PlayerState> make(JSONNode ruleNode)
        {
            string ruletype = ruleNode["type"];
            //Debug.Log("ruletype:"+ruletype);
            BaseRule<PlayerState> rule = null;

            ReallySimpleLogger.ReallySimpleLogger.WriteLog(
                typeof(JsonGameRuleFactory),string.Format("building rule of type:{0}",ruletype));

            if(ruletype.Equals("PlayerCrumbAllStateRule")){
                JSONArray crumbJson = ruleNode["state_crumb"].AsArray;
                string[] iA = new string[crumbJson.Count];

                int index = 0;
                foreach(JSONNode item in crumbJson){
                    iA[index] = (string)item;
                    index+=1;
                }

                string baseState = ruleNode["baseState"];
                string resultState = ruleNode["resultState"];

                //iAPlayer.state_crumbs = CollectionUtils.AsSet(iA);
                Player iAPlayer = new Player(){ State_crumbs = CollectionUtils.AsList(iA) };
                rule = new PlayerCrumbAllStateRule(new PlayerState(iAPlayer, baseState), resultState);

            } else if(ruletype.Equals("PlayerCrumbAnyStateRule")){
                JSONArray inventoryJson = ruleNode["state_crumb"].AsArray;
                string[] iA = new string[inventoryJson.Count];

                int index = 0;
                foreach(JSONNode item in inventoryJson){
                    iA[index] = (string)item;
                    index+=1;
                }

                string baseState = ruleNode["baseState"];
                string resultState = ruleNode["resultState"];

                Player iAPlayer = new Player(){ State_crumbs = CollectionUtils.AsList(iA) };
                //iAPlayer.state_crumbs = CollectionUtils.AsSet(iA);
                rule = new PlayerCrumbAnyStateRule(new PlayerState(iAPlayer, baseState), resultState);

            }
            //			else if(ruletype.Equals("PlayerStateFactorsRule")){
            //				//JSONNode playerNode = ruleNode["player"];
            //				Player p = new Player(ruleNode["player"]);
            //
            //				string baseState = ruleNode["baseState"];
            //				string resultState = ruleNode["resultState"];
            //				rule = new PlayerCrumbAnyStateRule(new PlayerState(p);
            //			}
            // Guard against a NULL rule
            if (rule == null)
            {
                throw new ArgumentNullException("rule is empty");
            }
            return rule;
        }
开发者ID:claytantor,项目名称:shadow-haven-unity,代码行数:59,代码来源:JsonGameRuleFactory.cs

示例8: Component

 public Component(GameObject obj, JSONNode node) 
     : base(node)
 {
     GameObject = obj;
     this.Transform = GameObject.Transform;
     this.Scene = GameObject.Scene;
     this.Enabled = true;
 }
开发者ID:mlohstroh,项目名称:LXE,代码行数:8,代码来源:Component.cs

示例9: GetList

 public List<string> GetList(JSONNode N)
 {
     List<string> l = new List<string>();
     foreach(string value in N.Childs){
         l.Add(value);
     }
     return l;
 }
开发者ID:kesumu,项目名称:dokidoki,代码行数:8,代码来源:BattleManager.cs

示例10: ParsePlanningCards

 private static int[] ParsePlanningCards(JSONNode json)
 {
     var len = json.Count;
     var result = new int[len];
     for (var i = 0; i < len; i++)
         result[i] = json[i].AsInt;
     return result;
 }
开发者ID:kleber-swf,项目名称:Risk-Management-Board-Game,代码行数:8,代码来源:Player.cs

示例11: Deserialize

 public static Player Deserialize(JSONNode json)
 {
     return new Player {
         Name = json["name"].Value,
         PlanningCards = ParsePlanningCards(json["planning-cards"]),
         UseOneMorePlanningSprint = json["use-one-more-planning-sprint"].AsBool
     };
 }
开发者ID:kleber-swf,项目名称:Risk-Management-Board-Game,代码行数:8,代码来源:Player.cs

示例12: Init

 public void Init(JSONNode enemyData)
 {
     var data = enemyData[Name];
     if (data["hp"] != null) Health = data["hp"].AsInt;
     if (data["sp"] != null) Shield = data["sp"].AsInt;
     if (data["delay"] != null) ShootDelay = data["delay"].AsFloat;
     Weapons = (from JSONNode weapon in data["weapons"].AsArray select new Weapon(weapon[1], weapon[0])).ToList();
 }
开发者ID:nightwolfz,项目名称:Game1,代码行数:8,代码来源:Model.cs

示例13: FromJson

 public static Ticket FromJson(JSONNode json)
 {
     Ticket ticket = new Ticket();
     ticket.Uri = json["uri"].Value;
     ticket.CompleteUri = json["complete_uri"].Value;
     ticket.TicketId = json["ticket_id"].Value;
     ticket.UploadLinkSecure = json["upload_link_secure"].Value;
     return ticket;
 }
开发者ID:uptredlabs,项目名称:Mobile,代码行数:9,代码来源:Ticket.cs

示例14: LoadJSON

 private void LoadJSON(string s)
 {
     try {
     JSONNode n = SimpleJSON.JSON.Parse(s);
     this.jsonConfig = n;
     } catch (JSONException e) {
     Debug.Log("No config loaded..." + e.ToString());
     }
 }
开发者ID:rlawther,项目名称:AmnesiaMuseumUnity,代码行数:9,代码来源:ConfigLoader.cs

示例15: FromJSON

 public override void FromJSON(Tile tile, JSONNode node)
 {
     tile.position.x = node ["x"].AsInt;
     tile.position.y = node ["y"].AsInt;
     tile.text = "E";
     tile.color = Color.green;
     name = node ["name"];
     description = node ["description"];
 }
开发者ID:ChoiIngon,项目名称:Rpg1994,代码行数:9,代码来源:EnterPoint.cs


注:本文中的SimpleJSON.JSONNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。