本文整理匯總了C#中System.Objects.GetBool方法的典型用法代碼示例。如果您正苦於以下問題:C# Objects.GetBool方法的具體用法?C# Objects.GetBool怎麽用?C# Objects.GetBool使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Objects
的用法示例。
在下文中一共展示了Objects.GetBool方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Load
/// <summary>
/// Loads data (waypoints, loot, targets, settings) from a binary file loaded into a Objects.Packet object.
/// </summary>
/// <param name="version">The version of LibreBot which created the file.</param>
/// <param name="p">The Objects.Packet object.</param>
/// <returns></returns>
private bool Load(ushort version, Objects.Packet p)
{
while (p.GetPosition < p.Length)
{
Enums.CavebotDatType type = (Enums.CavebotDatType)p.GetByte();
ushort count = 0;
switch (type)
{
case Enums.CavebotDatType.Settings:
switch (version)
{
case 212:
case 213:
this.CurrentSettings.EatFood = p.GetBool();
this.CurrentSettings.Exhaust = p.GetUInt16();
this.CurrentSettings.MinimumHealthToShoot = p.GetUInt16();
this.CurrentSettings.NodeRadius = p.GetByte();
this.CurrentSettings.NodeSkipRange = p.GetByte();
this.CurrentSettings.OpenContainers = p.GetBool();
this.CurrentSettings.PrioritizeDanger = p.GetBool();
this.CurrentSettings.StickToCreature = p.GetBool();
this.CurrentSettings.StopAttackingWhenOutOfRange = p.GetBool();
this.CurrentSettings.UseGoldStacks = p.GetBool();
this.CurrentSettings.CanUseMagicRope = p.GetBool();
this.CurrentSettings.UseAlternateNodeFinder = p.GetBool();
this.CurrentSettings.KillBeforeLooting = p.GetBool();
break;
default:
this.CurrentSettings.EatFood = p.GetBool();
this.CurrentSettings.Exhaust = p.GetUInt16();
this.CurrentSettings.MinimumHealthToShoot = p.GetUInt16();
this.CurrentSettings.NodeRadius = p.GetByte();
this.CurrentSettings.NodeSkipRange = p.GetByte();
this.CurrentSettings.OpenContainers = p.GetBool();
this.CurrentSettings.PrioritizeDanger = p.GetBool();
this.CurrentSettings.StickToCreature = p.GetBool();
this.CurrentSettings.StopAttackingWhenOutOfRange = p.GetBool();
this.CurrentSettings.UseGoldStacks = p.GetBool();
this.CurrentSettings.CanUseMagicRope = p.GetBool();
break;
}
break;
case Enums.CavebotDatType.Loot:
count = p.GetUInt16();
for (int i = 0; i < count; i++)
{
switch (version)
{
default:
Loot l = new Loot();
l.ID = p.GetUInt16();
l.Name = p.GetString();
l.Cap = p.GetUInt16();
string destination = p.GetString();
switch (destination.ToLower())
{
case "ground":
l.Destination = Loot.Destinations.Ground;
break;
default:
l.Destination = Loot.Destinations.EmptyContainer;
l.Index = byte.Parse(destination[1].ToString());
break;
}
this.AddLoot(l);
break;
case 213:
this.AddLoot(new Loot(p.GetUInt16(),
p.GetString(),
p.GetUInt16(),
(Loot.Destinations)p.GetByte(),
p.GetByte()));
break;
}
}
break;
case Enums.CavebotDatType.Targetting:
count = p.GetUInt16();
for (int i = 0; i < count; i++)
{
Target t = new Target(this);
t.Name = p.GetString();
if (version < 212) // load old settings (single setting environment)
{
Target.Setting setting = new Target.Setting(t);
setting.Count = p.GetByte();
setting.Range = p.GetByte();
setting.DistanceRange = 3;
setting.FightMode = (Enums.FightMode)p.GetByte();
setting.FightStance = (Enums.FightStance)p.GetByte();
p.GetString(); // ring
p.GetString(); // rune
setting.Spell = p.GetString();
setting.DangerLevel = p.GetByte();
//.........這裏部分代碼省略.........