當前位置: 首頁>>代碼示例>>C#>>正文


C# TradeAndTravel.Location類代碼示例

本文整理匯總了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;
     }
 }
開發者ID:BorislavIvanov,項目名稱:Telerik_Academy,代碼行數:7,代碼來源:Merchant.cs

示例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);
                    }
            }
        }
開發者ID:Varbanov,項目名稱:TelerikAcademy,代碼行數:26,代碼來源:AdvancedInteractionManager.cs

示例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);
     }
 }
開發者ID:AndrewMitev,項目名稱:Telerik-Academy,代碼行數:10,代碼來源:ExtendedInteractionManager.cs

示例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;
 }
開發者ID:Roshov,項目名稱:Telerik-Software-Academy-,代碼行數:12,代碼來源:MediatorInteractionManager.cs

示例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;
                }
            }
        }
開發者ID:jesusico83,項目名稱:Telerik,代碼行數:13,代碼來源:Item.cs

示例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;
 }
開發者ID:melliemello,項目名稱:TelerikAcademyHomeworks,代碼行數:16,代碼來源:InteractionsManagerExtended.cs

示例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;
        }
開發者ID:monikaBchvarova,項目名稱:C-Sharp,代碼行數:18,代碼來源:InteractionManagerExtended.cs

示例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;
 }
開發者ID:VictorGeorgiev,項目名稱:Telerik-Software-Academy,代碼行數:21,代碼來源:InteractionManager.cs

示例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;
        }
開發者ID:dirk-dagger-667,項目名稱:telerik-c--OOP-exam-prep,代碼行數:24,代碼來源:InteractionManagerExtended.cs

示例10: Weapon

 public Weapon(string name, Location location = null)
     : base(name, Weapon.InitialValue, ItemType.Weapon, location)
 {
 }
開發者ID:enchev-93,項目名稱:Telerik-Academy,代碼行數:4,代碼來源:Weapon.cs

示例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;
 }
開發者ID:alex687,項目名稱:SoftUni-Homeworks,代碼行數:16,代碼來源:InteractionManager.cs

示例12: Iron

 public Iron(string name, string type, Location location = null)
     : base(name, 3, type, location) { }
開發者ID:nikolay-radkov,項目名稱:Telerik-Academy,代碼行數:2,代碼來源:Iron.cs

示例13: Traveller

 public Traveller(string name, Location location)
     : base(name, location)
 {
 }
開發者ID:GenoGenov,項目名稱:TelerikAcademyAssignments,代碼行數:4,代碼來源:Text.cs

示例14: Iron

 public Iron(string name, Location location = null)
     : base(name, Iron.GeneralIronValue, ItemType.Iron, location)
 {
 }
開發者ID:NK-Hertz,項目名稱:Telerik-Academy-2014,代碼行數:4,代碼來源:Iron.cs

示例15: Person

 public Person(string name, Location location)
     : base(name)
 {
     this.Location = location;
     this.inventoryItems = new HashSet<Item>();
 }
開發者ID:GenoGenov,項目名稱:TelerikAcademyAssignments,代碼行數:6,代碼來源:Text.cs


注:本文中的TradeAndTravel.Location類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。