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


C# SFSObject.GetInt方法代码示例

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


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

示例1: Brand

	public Brand(SFSObject aObject) {
		id = aObject.GetInt("ID");
		owner = aObject.GetInt("Ow");
		Debug.Log (aObject.ToJson()); 
		try {
			fb = (long) Convert.ToInt64(aObject.GetFloat("FB"));
		} catch(Exception e) {
			try {
				fb = aObject.GetLong("FB");
			} catch(Exception e2) {
				fb = (long) aObject.GetDouble("FB");
			}
		}
		brand = aObject.GetUtfString("B"); 		
	}
开发者ID:dongvanhung,项目名称:HA3D,代码行数:15,代码来源:Brand.cs

示例2: fromSFSObject

    public override void fromSFSObject(SFSObject item)
    {
        this.id_Task = item.GetLong ("id_Task");
        this.id_Story=item.GetLong("id_Story");
        this.descripcion = item.GetUtfString ("descripcion");
        this.prioridad = item.GetInt ("prioridad");
        this.responsable = item.GetUtfString ("responsable");
        this.estado = item.GetUtfString ("estado");
        this.t_Total = item.GetInt ("t_Total");
        this.t_Estimado = item.GetInt ("t_Estimado");
        this.titulo = item.GetUtfString ("titulo");
        ISFSArray t = item.GetSFSArray ("testsAsociados");

        foreach (SFSObject s in t) {
            this.idTests.Add (s.GetLong ("Id_Test"));
        }
        // falta el burndownchart
    }
开发者ID:CristianCosta,项目名称:Kinect,代码行数:18,代码来源:Task.cs

示例3: onLoggedIn

	public void onLoggedIn(SFSObject aLoginData,SFSArray aHorses) {
		string challengeGoals = aLoginData.GetUtfString("ChallengeGoals");
		this.appleID = aLoginData.GetUtfString("AppleID");
		this.facebookID = Convert.ToString(aLoginData.GetLong("FacebookID"));
		this.googleID = aLoginData.GetUtfString("GoogleID");
		this.playerID = aLoginData.GetInt("ID");
		this.lastLogin = aLoginData.GetInt("LastLogin");
		this.playerName = aLoginData.GetUtfString("Username");
		this.referralRewardsReceived = aLoginData.GetInt("RewardsReceived");
		this.softCurrency = aLoginData.GetInt("SoftCurrency");
		this.hardCurrency = aLoginData.GetInt("HardCurrency");
		this.privilege = aLoginData.GetInt("Privilege");
		unpackHorses(aHorses); 
		this.selectedRaceHorse = this.horses[0];
		this.loggedIn = true;
		SFSObject obj = new SFSObject();
		obj.PutInt("l",selectedRaceHorse.level);
		SmartfoxConnectionHandler.REF.setMyName(this.playerName);
		SmartfoxConnectionHandler.REF.setMyHorseUserVar(selectedRaceHorse.compressedString(0));
		SmartfoxConnectionHandler.REF.sendMessage("rf2",obj);
	}
开发者ID:dongvanhung,项目名称:HA3D,代码行数:21,代码来源:PlayerMain.cs

示例4: SpawnResponse

    private void SpawnResponse( SFSObject sfsdata )
    {
        Debug.Log(sfsdata.GetDump());
        int id = sfsdata.GetInt ( "playerid" );
        if (id != SFSInstance.MySelf.Id)
        {
            GameManager.gameManager.assignRemoteHealth(id, sfsdata.GetFloat("health"));
        }
        else
        {
            Dictionary<string, object> data = new Dictionary<string, object>();
            /*
            float px = sfsdata.GetFloat ( "position.x" );
            float py = sfsdata.GetFloat ( "position.y" );
            float pz = sfsdata.GetFloat ( "position.z" );
            float rx = sfsdata.GetFloat ( "rotation.x" );
            float ry = sfsdata.GetFloat ( "rotation.y" );
            float rz = sfsdata.GetFloat ( "rotation.z" );
            float rw = sfsdata.GetFloat ( "rotation.w" );

            Dictionary<string, float> data = new Dictionary<string, float> ();
            data.Add ( "position.x", px );
            data.Add ( "position.y", py );
            data.Add ( "position.z", pz );
            data.Add ( "rotation.x", rx );
            data.Add ( "rotation.y", ry );
            data.Add ( "rotation.z", rz );
            data.Add ( "rotation.w", rw );

            data.Add("health", sfsdata.GetFloat("health"));
            data.Add("cooldown", sfsdata.GetFloat("cooldown"));
            data.Add("damage", sfsdata.GetFloat("damage"));
            data.Add("range", sfsdata.GetFloat("range"));
            */

            data.Add("ship", sfsdata.GetUtfString("ship"));
            data.Add("weapon", sfsdata.GetUtfString("weapon"));
            data.Add("clipsize", sfsdata.GetInt("clipsize"));
            data.Add("ammo", sfsdata.GetInt("ammo"));
            data.Add("cooldown", sfsdata.GetFloat("cooldown"));
            data.Add("range", sfsdata.GetFloat("range"));
            data.Add("health", sfsdata.GetFloat("health"));
            data.Add("velocity", sfsdata.GetFloat("velocity"));
            data.Add("energy", sfsdata.GetFloat("energy"));
            GameManager.gameManager.prespawnData = data;
            //OnEvent ( "spawn", data );
        }
    }
开发者ID:hollsteinm,项目名称:GSPSeniorProject,代码行数:48,代码来源:SFSClient.cs

示例5: DeathResponse

 private void DeathResponse( SFSObject sfsdata )
 {
     Debug.Log(sfsdata.GetInt("id"));
     OnEvent ( "player.remote.death", sfsdata.GetInt ( "id" ) );
 }
开发者ID:hollsteinm,项目名称:GSPSeniorProject,代码行数:5,代码来源:SFSClient.cs

示例6: ScoresResponse

    private void ScoresResponse(SFSObject sfsdata)
    {
        Dictionary<string, long> scores = new Dictionary<string, long>();
        Dictionary<string, string> names = new Dictionary<string, string>();
        long myscore = sfsdata.GetLong("my.score");

        int size = sfsdata.GetInt("size");
        for (int i = 0; i < size; ++i) {
            scores.Add("score" + i.ToString(), sfsdata.GetLong("score" + i.ToString()));
            names.Add("player" + i.ToString(), sfsdata.GetUtfString("player" + i.ToString()));
        }

        Dictionary<string, object> package = new Dictionary<string,object>();
        package.Add("scores", scores);
        package.Add("names", names);
        package.Add("my.score", myscore);

        OnEvent("scores", package);
    }
开发者ID:hollsteinm,项目名称:GSPSeniorProject,代码行数:19,代码来源:SFSClient.cs

示例7: ShootResponse

    private void ShootResponse(SFSObject sfsdata)
    {
        Dictionary<string, object> data = new Dictionary<string, object>();
        data.Add("position.x", sfsdata.GetFloat("position.x"));
        data.Add("position.y", sfsdata.GetFloat("position.y"));
        data.Add("position.z", sfsdata.GetFloat("position.y"));
        data.Add("rotation.x", sfsdata.GetFloat("rotation.x"));
        data.Add("rotation.y", sfsdata.GetFloat("rotation.y"));
        data.Add("rotation.z", sfsdata.GetFloat("rotation.z"));
        data.Add("rotation.w", sfsdata.GetFloat("rotation.w"));
        data.Add("damage", sfsdata.GetFloat("damage"));
        data.Add("speed", sfsdata.GetFloat("speed"));
        data.Add("range", sfsdata.GetFloat("range"));
        data.Add("networkId", sfsdata.GetInt("networkId"));

        //create instance of projectile
        //temporary
        if (sfsdata.GetInt("playerId") != SFSInstance.MySelf.Id) {
            GameManager.gameManager.CreateProjectile(data);
        } else {
            OnEvent("projectile.assign", data);
        }
    }
开发者ID:hollsteinm,项目名称:GSPSeniorProject,代码行数:23,代码来源:SFSClient.cs

示例8: PlayerHitResponse

    private void PlayerHitResponse( SFSObject sfsdata )
    {
        float damage = sfsdata.GetFloat ( "damage" );
        int playerid = sfsdata.GetInt ( "player.hit.id" );
        Debug.Log ( "Player hit: " + playerid.ToString () );

        Dictionary<string, object> fdata = new Dictionary<string, object> ();
        if (playerid == -1) {
            fdata.Add("player.hit.id", SFSInstance.MySelf.Id);
        } else {
            fdata.Add("player.hit.id", playerid);
        }
        fdata.Add ( "damage", damage );
        fdata.Add ( "contact.point.x", sfsdata.GetFloat ( "contact.point.x" ) );
        fdata.Add ( "contact.point.y", sfsdata.GetFloat ( "contact.point.y" ) );
        fdata.Add ( "contact.point.z", sfsdata.GetFloat ( "contact.point.z" ) );
        fdata.Add("playerid", sfsdata.GetInt("playerid"));

        if ( playerid == SFSInstance.MySelf.Id ) {
            OnEvent ( "player.hit", fdata );
        } else {
            OnEvent ( "player.remote.hit", fdata );
        }
    }
开发者ID:hollsteinm,项目名称:GSPSeniorProject,代码行数:24,代码来源:SFSClient.cs

示例9: PowerUpResponse

 private void PowerUpResponse(SFSObject data)
 {
     string type = data.GetUtfString("powerup");
     int id = data.GetInt("playerid");
     Debug.Log("Powerup Response. (ID: " + id.ToString() + "Type: " + type);
     Dictionary<string, object> cdata = new Dictionary<string, object>();
     cdata.Add("powerup", type);
     cdata.Add("playerid", id);
     OnEvent("powerup", cdata);
 }
开发者ID:hollsteinm,项目名称:GSPSeniorProject,代码行数:10,代码来源:SFSClient.cs

示例10: HandlePlayerTransformResponse

    private void HandlePlayerTransformResponse(SFSObject sfsdata)
    {
        int id = sfsdata.GetInt("player");

        float px = sfsdata.GetFloat("position.x");
        float py = sfsdata.GetFloat("position.y");
        float pz = sfsdata.GetFloat("position.z");
        float rx = sfsdata.GetFloat("rotation.x");
        float ry = sfsdata.GetFloat("rotation.y");
        float rz = sfsdata.GetFloat("rotation.z");
        float rw = sfsdata.GetFloat("rotation.w");

        //hack, needs to be fixed
        if (!GameManager.gameManager.Players.ContainsKey(id) && id != SFSInstance.MySelf.Id) {
            //GameManager.gameManager.AddRemotePlayer(id, "[!]ERROR[!]" + id.ToString());
            //early out
            Debug.LogWarning("Null Player sending messages: " + id.ToString());
            return;
        }

        Dictionary<string, object> data = new Dictionary<string, object>();
        data.Add("id", id);
        data.Add("type", sfsdata.GetUtfString("type"));
        data.Add("position.x", px);
        data.Add("position.y", py);
        data.Add("position.z", pz);
        data.Add("rotation.x", rx);
        data.Add("rotation.y", ry);
        data.Add("rotation.z", rz);
        data.Add("rotation.w", rw);
        OnEvent("transform", data);
    }
开发者ID:hollsteinm,项目名称:GSPSeniorProject,代码行数:32,代码来源:SFSClient.cs

示例11: HandleProjectileTransformResponse

    private void HandleProjectileTransformResponse(SFSObject sfsdata)
    {
        int id = sfsdata.GetInt("networkId");

        float px = sfsdata.GetFloat("position.x");
        float py = sfsdata.GetFloat("position.y");
        float pz = sfsdata.GetFloat("position.z");
        float rx = sfsdata.GetFloat("rotation.x");
        float ry = sfsdata.GetFloat("rotation.y");
        float rz = sfsdata.GetFloat("rotation.z");
        float rw = sfsdata.GetFloat("rotation.w");

        Dictionary<string, object> data = new Dictionary<string, object>();
        data.Add("id", id);
        data.Add("type", sfsdata.GetUtfString("type"));
        data.Add("position.x", px);
        data.Add("position.y", py);
        data.Add("position.z", pz);
        data.Add("rotation.x", rx);
        data.Add("rotation.y", ry);
        data.Add("rotation.z", rz);
        data.Add("rotation.w", rw);
        OnEvent("transform", data);
    }
开发者ID:hollsteinm,项目名称:GSPSeniorProject,代码行数:24,代码来源:SFSClient.cs

示例12: SetupTheFox

    private void SetupTheFox()
    {
        bool debug = true;
        running = true;
        if (SmartFoxConnection.IsInitialized)
        {
            smartFox = SmartFoxConnection.Connection;
        }
        else
        {
            smartFox = new SmartFox(debug);
        }
        currentRoom = smartFox.LastJoinedRoom;
        clientName = smartFox.MySelf.Name;

        // set up arrays of positions
        positions = new List<Vector3>();
        GameObject[] spawnPoints = GameObject.FindGameObjectsWithTag("SpawnTag");
        for (int i = 0; i < spawnPoints.Length; i++)
        {
            positions.Add(spawnPoints[i].transform.position);
        }

        lobbyGameInfo = (SFSObject)currentRoom.GetVariable("gameInfo").GetSFSObjectValue();

        host = lobbyGameInfo.GetUtfString("host");
        numberOfTeams = lobbyGameInfo.GetInt("numTeams");
        numberOfPlayers = currentRoom.GetVariable("numberOfPlayers").GetIntValue();
        teams = (SFSArray)lobbyGameInfo.GetSFSArray("teams");
        gameLength = lobbyGameInfo.GetInt("gameLength");

        gameLength = (int)lobbyGameInfo.GetInt("gameLength") * 1000;

        SetupListeners();
    }
开发者ID:ice0001,项目名称:Cubes-in-Space,代码行数:35,代码来源:GameManager.cs

示例13: HandleObjectUpdate

    public static void HandleObjectUpdate(SFSObject message)
    {
        string type = message.GetUtfString ("objectType");
        float xPos = message.GetFloat ("xPos");
        float yPos = message.GetFloat ("yPos");
        float zPos = message.GetFloat ("zPos");
        float xRot = message.GetFloat ("xRot");
        float yRot = message.GetFloat ("yRot");
        float zRot = message.GetFloat ("zRot");

        float xDir = message.GetFloat ("xDir");
        float yDir = message.GetFloat ("yDir");
        float zDir = message.GetFloat ("zDir");

        int blockType = message.GetInt ("blockType");

        string[] cubeIDs = message.GetUtfStringArray ("cubeIDs");
        string id = message.GetUtfString ("ID");
        int animType = message.GetInt ("charAnim");

        float Speed = message.GetFloat ("Speed");
        bool Hit = message.GetBool ("Hit");
        bool Jump = message.GetBool ("Jump");

        Vector3 position = new Vector3 (xPos, yPos, zPos);
        Quaternion rotation = Quaternion.Euler(new Vector3(xRot, yRot, zRot));
        Vector3 forward = new Vector3 (xDir, yDir, zDir);

        switch (type) {
        case "Block":
            UpdateBlockObject(blockType, id, cubeIDs, position, rotation);
            break;

        case "Bar":
                UpdateBarObject(id, position, rotation);
            break;

        case "Ball":
                UpdateBallObject(id, position, rotation);
            break;

        case "Character":
            UpdateCharacterObject (id, (CharacterAnimType)animType, position, rotation, forward, Speed, Hit, Jump);
            break;
        }
    }
开发者ID:xzs424,项目名称:PunchMe,代码行数:46,代码来源:GameManager.cs

示例14: handleRacePositionsBroadcast

	public void handleRacePositionsBroadcast(SFSObject aObject) {
		if(aObject.ContainsKey("a")) {
			SFSArray a = (SFSArray) aObject.GetSFSArray("a");
			int f = aObject.GetInt("f");
			for(int i = 0;i<a.Size();i++) {
				initPacketFromHost((SFSObject) a.GetSFSObject(i));
			}
		//Time.timeScale = 0.01f;

			for(int i = f;i<framesPassed;i++) {
				for(int j = 0;j<this.sortedHorses.Count;j++) {
					sortedHorses[j].FixedUpdate();
				}
			}
			for(int i = 0;i<sortedHorses.Count;i++) {
				Vector3 posDiff = sortedHorses[i].transform.position-sortedHorses[i].originalPosition;
			//	Debug.Log ("Position was wrong by: "+posDiff+" last applied speed was: "+sortedHorses[i].lastAppliedSpeed);
			}
		}
		
	}
开发者ID:dongvanhung,项目名称:HA3D,代码行数:21,代码来源:RaceTrack.cs

示例15: loadFromSFSObject

	public void loadFromSFSObject(SFSObject aSFSObject) {
		if(aSFSObject.GetSFSObject("horses")!=null)
		{ 
			aSFSObject = aSFSObject.GetSFSObject("horses") as SFSObject;
		} 
		this.accelerationBase = aSFSObject.GetLong("Acceleration");
		this.baseLayer = aSFSObject.GetInt("BaseLayer");
		this.blanket = aSFSObject.GetInt("Blanket");
		this.cadence = aSFSObject.GetLong("Cadence");
		this.determination = aSFSObject.GetLong("Determination");
		this.fatigue = aSFSObject.GetInt("Fatigue");
		this.salePrice = aSFSObject.GetInt("ForSale");
		this.happiness = aSFSObject.GetInt("Happiness");
		this.headwear = aSFSObject.GetInt("Headwear");
		Debug.LogError("TODO: Make this load health data");
		//	this.HealthDataFromString(aSFSObject.GetUtfString("HealthData"));
		this.height = aSFSObject.GetInt("Height");
		
		Debug.LogError("TODO: Make this load horse record data");
		//this.horseRecordFromString(aSFSObject.GetUtfString("HorseRecord"));
		this.horseScore = aSFSObject.GetInt("HorseScore");
		this.hunger = aSFSObject.GetInt("Hunger");
		this.horseID = aSFSObject.GetInt("ID");
		this.jumping = aSFSObject.GetLong("Jumping");
		this.lastUpdated = aSFSObject.GetInt("LastUpdate");
		this.legWear = aSFSObject.GetInt("LegWear1");
		this.legWear2 = aSFSObject.GetInt("LegWear2");
		this.level = aSFSObject.GetInt("Level");
		this.mane = aSFSObject.GetInt("Mane");
		try {
			this.maxMPH = (float) aSFSObject.GetDouble("MaxSpeed");
		} catch(Exception e) {
			try {
				this.maxMPH = aSFSObject.GetFloat("MaxSpeed");
			} catch(Exception e2) {
				this.maxMPH = 0.0f;
			}
		}
		string nameStr = aSFSObject.GetUtfString("Name");
		this._baseName = nameStr;
		
		try {
		if(aSFSObject.GetDouble("OriginalOwner")>0)
			this.originalOwnerID = (long) aSFSObject.GetDouble("OriginalOwner");
		} catch(Exception e) { 
			if(aSFSObject.GetLong("OriginalOwner")>0)
				this.originalOwnerID = aSFSObject.GetLong("OriginalOwner");
		}
		
		if(aSFSObject.GetInt("OwnerID")>0)
			this.ownerID = (long) aSFSObject.GetInt("OwnerID");
		
		
		//this.setPassportFromString(aSFSObject.GetUtfString("PassportString"));
		this.overlay = aSFSObject.GetInt("PatternLayer1");
		this.potential = aSFSObject.GetInt("Potential");
		this.birthTime = aSFSObject.GetInt("PregnantReturnTime");
		this.recovery = aSFSObject.GetLong("Recovery");
		this.reintype = aSFSObject.GetInt("ReinType"); 
		this.trainingReturnTime = aSFSObject.GetInt("ReturnFromTrainingTime");
		this.saddle = aSFSObject.GetInt("SaddleType");
		this.gender= (EGender) aSFSObject.GetInt("Sex");
		this.speed = aSFSObject.GetLong("Speed");
		this._stamina = aSFSObject.GetLong("Stamina");
		this.stridelength = aSFSObject.GetLong("StrideLength");
		this.surfacePreference = (ESurfaceType) aSFSObject.GetInt("SurfacePreference");
		this.tail = aSFSObject.GetInt("Tail");
		if(tail>0&&tail<12300) {
			tail = 12300;
		}
		if(mane>0&&mane<12200) {
			mane = 12200;
		}
		this.horseTalents.talents = (aSFSObject.GetUtfString("Talents"));
		this.dateborn = aSFSObject.GetInt("TimeCreated");
		
		Debug.LogError("TODO: Make this load trophies owned");
		//this.trophiesOwned(aSFSObject.GetUtfString("Trophies"));
		this.xp = aSFSObject.GetLong("XP");
		this.studFee = (long) aSFSObject.GetInt("StudFee");
		
		this.personalityBigRacer = aSFSObject.GetInt("PersonalityBigRacer");
		this.personalityProfessional = aSFSObject.GetInt("PersonalityProfessional");
		this.personalityAdaptable = aSFSObject.GetInt("PersonalityAdaptable");
		this.personalityJumper = aSFSObject.GetInt("PersonalityA");
		this.personalityChaser = aSFSObject.GetInt("PersonalityB");
		
		this.motherID = aSFSObject.GetInt("Mother");
		this.fatherID = aSFSObject.GetInt("Father");
		
	}
开发者ID:dongvanhung,项目名称:HA3D,代码行数:91,代码来源:HorseData.cs


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