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


C# JSONObject.GetBoolean方法代码示例

本文整理汇总了C#中JSONObject.GetBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# JSONObject.GetBoolean方法的具体用法?C# JSONObject.GetBoolean怎么用?C# JSONObject.GetBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JSONObject的用法示例。


在下文中一共展示了JSONObject.GetBoolean方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Deserialize

		public override void Deserialize(JSONObject obj)
		{
			Ranks = (int)obj.GetNumber(cRanks);
			MiscModifier = (int)obj.GetNumber(cModifier);
			CanBeUsedUntrained = obj.GetBoolean(cUntrained);
			ClassSkill = obj.GetBoolean(cClassSkill);
			KeyAbility = (DnDAbilities)(int)obj.GetNumber(cAbility);

		}
开发者ID:impjmichel,项目名称:SpellMastery2.0,代码行数:9,代码来源:DnDSkillModel.cs

示例2: SetResults

  public void SetResults(JSONObject jsonData) {
		spinDataResult = jsonData;
    resultsData = jsonData.GetArray("items");
    winningGold = jsonData.GetArray("wGold");
		// Calculate extra data (winning type, winning count from list result items)
		JSONObject extraData = SlotCombination.CalculateCombination(resultsData, GetNumLine());
    winningCount = extraData.GetArray("wCount");
    winningType = extraData.GetArray("wType");
		//
    isJackpot = jsonData.GetBoolean("isJP");
		freeSpinLeft = jsonData.GetInt("frLeft");
		isBigWin = jsonData.GetBoolean("bWin");
		gotFreeSpin = jsonData.GetInt("frCount") > 0;
		// bool[] winingItems = new bool[15];
		// for (int i = 0; i < winningGold.Length; i++) {
		// 	if (winningGold[i].Number > 0) {
		// 		for (int j = 0; j < SlotCombination.NUM_REELS; j++) {
		// 			winingItems[SlotCombination.COMBINATION[i, j]] = true;
		// 		}
		// 	}
		// }
    for (int i = 0; i < slotReels.Length; i++) {
      slotReels[i].SetResults(new int[3] { (int)resultsData[i * 3].Number, (int)resultsData[i * 3 + 1].Number, (int)resultsData[i * 3 + 2].Number });
    }
  }
开发者ID:markofevil3,项目名称:SlotMachine,代码行数:25,代码来源:SlotMachine.cs

示例3: Init

	public void Init(JSONObject jsonData) {
		userId = jsonData.GetString("userId");
		seatIndex = jsonData.GetInt("seatIndex");
		isHost = jsonData.GetBoolean("isHost");
		state = (State)jsonData.GetInt("state");
		hand = new TLMBHand();

		if (SmartfoxClient.Instance.IsYou(userId)) {
			AddCards(jsonData.GetString("cards"));
		} else {
			int numCards = jsonData.GetInt("numCards");

			for (int i = 0; i < numCards; i++) {
				hand.AddCard(new TLMBCard(-1));
			}
		}
	}
开发者ID:markofevil3,项目名称:SlotMachine,代码行数:17,代码来源:TLMBGame.cs

示例4: init

    public void init(JSONObject json)
    {
        if(json.GetValue("Id") != null ){this.Id = json.GetString("Id");}
        if(json.GetValue("Acount") != null ){this.accountName = json.GetString("Acount");}
        if(json.GetValue("Amount") != null ){this.amount = json.GetString("Amount");}
        if(json.GetValue("CloseDate") != null ) {this.closeDate = json.GetString("CloseDate");}
        //if(json.GetValue("Contract") != null ) {this.contract = json.GetString("Contract");}
        if(json.GetValue("CreatedBy") != null ) {this.createdBy = json.GetString("CreatedBy");}
        if(json.GetValue("Description") != null ) {this.description = json.GetString("Description");}
        if(json.GetValue("ExpectedRevenue") != null ) {this.expectedRevenue = json.GetNumber("ExpectedRevenue");}
        if(json.GetValue("ForecastCategoryName") != null ) {this.forecastCategoryName = json.GetString("ForecastCategoryName");}
        if(json.GetValue("LastModifiedBy") != null ) {this.lastModifiedBy = json.GetString("LastModifiedBy");}
        if(json.GetValue("LeadSource") != null ) {this.leadSource = json.GetString("LeadSource");}
        if(json.GetValue("NextStep") != null ) {this.nextStep = json.GetString("NextStep");}
        if(json.GetValue("Name") != null ) {this.oppName = json.GetString("Name");}
        if(json.GetValue("Owner") != null ) {this.owner = json.GetString("Owner");}
        if(json.GetValue("Pricebook2") != null ) {this.pricebook2 = json.GetString("Pricebook2");}
        if(json.GetValue("IsPrivate") != null ) {this.isPrivate = json.GetBoolean("IsPrivate");}
        if(json.GetValue("Probability") != null ) {this.probability = json.GetNumber("Probability");}
        if(json.GetValue("TotalOpportunityQuantity") != null ) {this.quantity = json.GetNumber("TotalOpportunityQuantity");}
        if(json.GetValue("StageName") != null ) {this.stageName = json.GetString("StageName");}
        if(json.GetValue("Type") != null ) {this.type = json.GetString("Type");}
        if(json.GetValue("Urgent__c") != null ) {this.urgent = (float)json.GetNumber("Urgent__c");}
        if(json.GetValue("Urgent__c") != null ) {this.urgent = (float)json.GetNumber("Urgent__c");}

        //create and add account.
        if(json.GetObject("Account") != null){

            Account account = Account.CreateInstance("Account") as Account;
            account.init(json.GetObject("Account"));

            this.account = account;

        }

        //create and add opportunitylineitems/oppProducts
        if(json.GetObject("OpportunityLineItems") != null){

            JSONArray rowRecords = json.GetObject("OpportunityLineItems").GetArray ("records");

            List <OpportunityProduct> oppProducts = new List<OpportunityProduct>();

            foreach (JSONValue row in rowRecords) {

                OpportunityProduct oppProduct = OpportunityProduct.CreateInstance("OpportunityProduct") as OpportunityProduct;
                Debug.Log("opp product" + row.ToString());
                JSONObject rec = JSONObject.Parse(row.ToString());
                oppProduct.init(rec);
                oppProducts.Add(oppProduct);

            }

            this.oppProducts = oppProducts;

        }

        //create and add campaign.
        if(json.GetObject("Campaign") != null){

            Campaign campaign = Campaign.CreateInstance("Campaign") as Campaign;
            campaign.init(json.GetObject("Campaign"));

            this.campaign = campaign;

        }

        //create and add account.
        if(json.GetObject("Contract") != null){

            Contract contract = Contract.CreateInstance("Contract") as Contract;
            contract.init(json.GetObject("Contract"));

            this.contract = contract;

        }
    }
开发者ID:CodeScience,项目名称:VRpportunity,代码行数:76,代码来源:Opportunity.cs

示例5: getResultForWemePush

	// wemePush urlscheme parse
	public JSONObject getResultForWemePush(string scheme,string host,JSONObject jsonObject){
		host = host.ToLower();
		switch(host){
			case "isallowpushmessage":
				JSONObject pushallowResult = JSONObject.Parse(((TextAsset)Resources.Load("JSONRequests/"+scheme+"/"+host)).text);
				pushallowResult.Remove("allow");
				pushallowResult.Add("allow",onPush);
				return pushallowResult;

			case "requestallowpushmessage":
				if(jsonObject.ContainsKey("allow")){
					JSONObject requestPushResult = JSONObject.Parse(((TextAsset)Resources.Load("JSONRequests/"+scheme+"/"+host)).text);
					onPush = jsonObject.GetBoolean("allow");
					requestPushResult.Remove("allow");
					requestPushResult.Add("allow",onPush);
					return requestPushResult;
				}else{
					return jsonResultForError("WmInterfaceBroker",(long)WemeManager.WemeErrType.WM_ERR_INVALID_PARAMETER,"invalid_parameter",scheme+"://"+host);
				}
		}
		return jsonResultForError("WmInterfaceBroker",(long)WemeManager.WemeErrType.WM_ERR_INVALID_PARAMETER,"invalid_parameter",scheme+"://"+host);
	}
开发者ID:ftcaicai,项目名称:ArkClient,代码行数:23,代码来源:WmInterfaceBroker.cs


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