本文整理汇总了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) );
}
});
}
示例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;
}
示例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;
}
示例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"));
}