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


C# Job.ToString方法代码示例

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


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

示例1: Net_RequestNodeData

	private static void Net_RequestNodeData( Job.Type _jobType, string _nodeTypeName )
	{
		if( !GS.Available )
		{
			Debug.LogError("!!Unhandled behaviour!! Requesting node data without an active GS connection" );
			return;
		}

		new LogEventRequest()
			.SetEventKey("NODE_DATA")
			.SetEventAttribute("JobType", _jobType.ToString())
			.SetEventAttribute("NodeType", _nodeTypeName)
			.Send((response) =>
			{
				if (response.HasErrors)
					Debug.Log("Node info net request failed: " + response.Errors.JSON);
				else
				{
					NodeData data;

					int? experience = response.ScriptData.GetInt("Experience");
					int? energyCost = response.ScriptData.GetInt("EnergyCost");
					float? cooldown = response.ScriptData.GetFloat("Cooldown");

					Debug.Log("Node Data [" + (_jobType).ToString() + "][" + _nodeTypeName + "]: Experience: " + experience + ", EnergyCost: " + energyCost + ", Cooldown: " + cooldown);

					data.Experience = (int)experience;
					data.EnergyCost = (int)energyCost;
					data.Cooldown = (float)cooldown;

					// Cache this node data information
					m_NodeDataEntries[_jobType][_nodeTypeName] = data;

					// Fire this information to all of our callbacks
					m_NodeDataRequestCallbacks[_jobType][_nodeTypeName].ForEach( cb => cb(data) );
				}
			});
	}
开发者ID:predominant,项目名称:Treasure_Chest,代码行数:38,代码来源:ServerDataProxy.cs

示例2: CreateCharacter

        public WorldCharacter CreateCharacter(string name, byte slot, byte hair, byte color, byte face, Job job, bool ismale)
        {
            if (Characters.ContainsKey(slot) || slot > 5)
                return null;
            //TODO: check if hair etc are actual beginner ones! (premium hack)

            BaseStatsEntry stats = DataProvider.Instance.JobBasestats[job];
            if (stats == null)
            {
                Log.WriteLine(LogLevel.Warn, "Houston, we have a problem! Jobstats not found for job {0}", job.ToString());
                return null;
            }

            Character newchar = new Character();
            newchar.AccountID = this.AccountID;
            newchar.CharLevel = 1;
            newchar.Name = name;
            newchar.Face = face;
            newchar.Hair = hair;
            newchar.HairColor = color;
            newchar.Job = (byte)job;
            newchar.Male = ismale;
            newchar.Slot = slot;
            newchar.XPos = 7636;
            newchar.YPos = 4610;
            newchar.HP = (short)stats.MaxHP;
            newchar.SP = (short)stats.MaxSP;
            newchar.HPStones = (short)stats.MaxHPStones;
            newchar.SPStones = (short)stats.MaxSPStones;
            Program.Entity.AddToCharacters(newchar);
            int charID = newchar.ID;
            ushort begineqp = GetBeginnerEquip(job);
            if (begineqp > 0)
            {
                DatabaseEquip eqp = new DatabaseEquip();
                eqp.EquipID = begineqp;
                eqp.Slot = (short)((job == Job.Archer) ? -10 : -12);
                newchar.Equips.Add(eqp);
            }
            Program.Entity.SaveChanges();
            WorldCharacter tadaa = new WorldCharacter(newchar, (job == Job.Archer) ? (byte)12 : (byte)10, begineqp);
            Characters.Add(slot, tadaa);
            return tadaa;
        }
开发者ID:iFeddy,项目名称:SolarFiesta,代码行数:44,代码来源:WorldClient.cs

示例3: CreateCharacter

        public WorldCharacter CreateCharacter(string name, byte slot, byte hair, byte color, byte face, Job job, bool ismale)
        {
            if (Characters.ContainsKey(slot) || slot > 5)
                return null;
            //TODO: check if hair etc are actual beginner ones! (premium hack)
            //NOTE: Check the SHN's for this -> Moved to database
            BaseStatsEntry stats = DataProvider.Instance.JobBasestats[job];
            if (stats == null)
            {
                //NOTE be serious.. please
                // Log.WriteLine(LogLevel.Warn, "Houston, we have a problem! Jobstats not found for job {0}", job.ToString());
                Log.WriteLine(LogLevel.Error, "Jobstats not found for job {0}", job.ToString());
                return null;
            }
            Database.Storage.LookInfo newLook = new Database.Storage.LookInfo();
            Database.Storage.PositionInfo newPos = new Database.Storage.PositionInfo();
            Database.Storage.Character newchar = new Database.Storage.Character();
            newchar.AccountID = this.AccountID;
            newchar.CharLevel = 1;
            newchar.Name = name;
            newLook.Face = face;
            newLook.Hair = hair;
            newLook.HairColor = color;
            newchar.Job = (byte)job;
            newLook.Male = ismale;
            newchar.Slot = slot;
            newPos.XPos = 7636;
            newPos.YPos = 4610;
            newchar.HP = (short)stats.MaxHP;
            newchar.SP = (short)stats.MaxSP;
            newchar.HPStones = (short)stats.MaxHPStones;
            newchar.SPStones = (short)stats.MaxSPStones;
            newchar.LookInfo = newLook;
            newchar.PositionInfo = newPos;
            int charID = newchar.ID;
             DatabaseClient client = Program.DatabaseManager.GetClient();

             string query =
                 "INSERT INTO `characters` " +
                 "(`AccountID`,`Name`,`MasterJoin`,`Slot`,`Job`,`Male`,`Hair`,`HairColor`,`Face`," +
                 " `QuickBar`, `QuickBarState`, `ShortCuts`, `GameSettings`, `ClientSettings`) " +
                 "VALUES " +
                     "('" + newchar.AccountID +
                     "', '" + newchar.Name +
                     "', '" + DateTime.Now.ToDBString() +
                        "', " +		newchar.Slot +
                        ", " +		newchar.Job  +
                        ", " +		Convert.ToByte(newchar.LookInfo.Male) +
                        ", " +		newchar.LookInfo.Hair +
                        ", " +		newchar.LookInfo.HairColor +
                        ", " +		newchar.LookInfo.Face +
                        ", " +      "0" +
                        ", " +      "0" +
                        ", " +      "0" +
                        ", " +      "0" +
                        ", " +      "0" +
                        ")";
                client.ExecuteQuery(query);

            WorldCharacter tadaa = new WorldCharacter(newchar,this);
            ushort begineqp = GetBeginnerEquip(job);

            if (begineqp > 0)
            {
                sbyte eqp_slot = (sbyte)((job == Job.Archer) ? -10 : -12); //, (job == Job.Archer) ? (byte)12 : (byte)10, begineqp)
                Equip eqp = new Equip((uint)newchar.ID, begineqp, eqp_slot);
                tadaa.Inventory.AddToEquipped(eqp);
                client.ExecuteQuery("INSERT INTO equips (owner,slot,EquipID) VALUES ('"+tadaa.ID+"','"+eqp_slot+"','"+eqp.EquipID+"')");
            }
            Characters.Add(slot, tadaa);
            return tadaa;
        }
开发者ID:Dextan,项目名称:Estrella,代码行数:72,代码来源:WorldClient.cs

示例4: ToStringTest

 public void ToStringTest()
 {
     Owner owner = new Owner("Test owner");
       byte CPU = 3;
       uint ExpectedRuntime = 42;
       Job target = new Job("ToString Test", owner, CPU, ExpectedRuntime);
       string actual = target.ToString();
       Assert.IsTrue(target.ToString().Contains(owner.Name));
       Assert.IsTrue(target.ToString().Contains("42"));
       Assert.IsTrue(target.ToString().Contains("3"));
       Assert.IsTrue(target.ToString().Contains("Created"));
 }
开发者ID:ButterFree,项目名称:AS38,代码行数:12,代码来源:JobTest.cs


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