本文整理汇总了C#中TradeAndTravel.Location类的典型用法代码示例。如果您正苦于以下问题:C# Location类的具体用法?C# Location怎么用?C# Location使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Location类属于TradeAndTravel命名空间,在下文中一共展示了Location类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TravelTo
public void TravelTo(Location location)
{
if (location != null)
{
this.Location = location;
}
}
示例2: CreateItem
protected override Item CreateItem(string itemTypeString, string itemNameString, Location itemLocation, Item item)
{
switch (itemTypeString)
{
case "weapon":
{
item = new Weapon(itemNameString, itemLocation);
return item;
}
case "wood":
{
item = new Wood(itemNameString, itemLocation);
return item;
}
case "iron":
{
item = new Iron(itemNameString, itemLocation);
return item;
}
default:
{
return base.CreateItem(itemTypeString, itemNameString, itemLocation, item);
}
}
}
示例3: CreatePerson
protected override Person CreatePerson(string personTypeString, string personNameString, Location personLocation)
{
switch (personTypeString)
{
case "merchant":
return new Merchant(personNameString, personLocation);
default:
return base.CreatePerson(personTypeString, personNameString, personLocation);
}
}
示例4: CreatePerson
protected override Person CreatePerson(string personTypeString, string personNameString, Location personLocation)
{
Person person = null;
switch (personTypeString)
{
case "merchant":
person = new Merchant(personNameString, personLocation);
break;
default: return base.CreatePerson(personTypeString, personNameString, personLocation);
}
return person;
}
示例5: Item
protected Item(string name, int itemValue, string type, Location location = null)
: base(name)
{
this.Value = itemValue;
foreach (var itemType in (ItemType[])Enum.GetValues(typeof(ItemType)))
{
if (itemType.ToString() == type)
{
this.ItemType = itemType;
}
}
}
示例6: CreateItem
protected override Item CreateItem(string itemTypeString, string itemNameString, Location itemLocation, Item item)
{
switch (itemTypeString)
{
case "weapon":
item = new Weapon(itemNameString, itemLocation);
break;
case "iron":
item = new Iron(itemNameString, itemLocation);
break;
default:
return base.CreateItem(itemTypeString, itemNameString, itemLocation,item);
break;
}
return item;
}
示例7: CreateItem
protected override Item CreateItem(string itemTypeString, string itemNameString, Location itemLocation, Item item)
{
Item itemToBeCreated = null;
switch (itemTypeString)
{
case "weapon":
itemToBeCreated = new Weapon(itemNameString, itemLocation);
break;
case "wood":
itemToBeCreated = new Wood(itemNameString, itemLocation);
break;
default:
itemToBeCreated = base.CreateItem(itemTypeString, itemNameString, itemLocation, itemToBeCreated);
break;
}
return itemToBeCreated;
}
示例8: CreateItem
protected virtual Item CreateItem(string itemTypeString, string itemNameString, Location itemLocation, Item item)
{
switch (itemTypeString)
{
case "armor":
item = new Armor(itemNameString, itemLocation);
break;
case "weapon":
item = new Weapon(itemNameString, itemLocation);
break;
case "wood":
item = new Wood(itemNameString, itemLocation);
break;
case "iron":
item = new Iron(itemNameString, itemLocation);
break;
default:
break;
}
return item;
}
示例9: CreateItem
protected override Item CreateItem(string itemTypeString, string itemNameString, Location itemLocation, Item item)
{
if (itemTypeString == "armor")
{
base.CreateItem(itemTypeString, itemNameString, itemLocation, item);
}
switch (itemTypeString)
{
case "weapon":
item = new Weapon(itemNameString, itemLocation);
break;
case "wood":
item = new Wood(itemNameString, itemLocation);
break;
case "iron":
item = new Iron(itemNameString, itemLocation);
break;
default:
break;
}
return item;
}
示例10: Weapon
public Weapon(string name, Location location = null)
: base(name, Weapon.InitialValue, ItemType.Weapon, location)
{
}
示例11: CreatePerson
protected virtual Person CreatePerson(string personTypeString, string personNameString, Location personLocation)
{
Person person = null;
switch (personTypeString)
{
case "shopkeeper":
person = new Shopkeeper(personNameString, personLocation);
break;
case "traveller":
person = new Traveller(personNameString, personLocation);
break;
default:
break;
}
return person;
}
示例12: Iron
public Iron(string name, string type, Location location = null)
: base(name, 3, type, location) { }
示例13: Traveller
public Traveller(string name, Location location)
: base(name, location)
{
}
示例14: Iron
public Iron(string name, Location location = null)
: base(name, Iron.GeneralIronValue, ItemType.Iron, location)
{
}
示例15: Person
public Person(string name, Location location)
: base(name)
{
this.Location = location;
this.inventoryItems = new HashSet<Item>();
}