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


C# Solution.AddItem方法代码示例

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


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

示例1: GetGameForProf

        public Game GetGameForProf()
        {
            string wvPlayerID = "15-01-2016-10-50-42_alberto";
            string wvPlayerName = "alberto";

            ItemGraficalProperty wvProperty = new ItemGraficalProperty();
            Solution wvSolution = new Solution();
            List<Room> wvRooms = new List<Room>();
            List<Item> wvItems;

            AbstractItem wvAbstract;

            wvRooms.Add(new Room(E_RoomsName.START_ROOM));

            #region Room = LIVINGROOM
            wvItems = new List<Item>();

            #region A -> ID 19
            wvAbstract = new AbstractItem(E_ItemType.A, E_ItemKind.TROUSERS);
            wvProperty.SetContent(E_PropertiesKind.COLOR, E_Color.BLUE);
            wvAbstract.AddProperty(wvProperty);

            wvProperty = new ItemGraficalProperty();
            wvProperty.SetContent(E_PropertiesKind.GRADIATION, E_Gradiation.LIGHT);
            wvAbstract.AddProperty(wvProperty);

            wvProperty = new ItemGraficalProperty();
            wvProperty.SetContent(E_PropertiesKind.TEXTURE, E_Texture.SCOTTISH);
            wvAbstract.AddProperty(wvProperty);

            wvItems.Add(GetItem(wvAbstract, E_Items.AOne));
            wvSolution.AddItem(wvAbstract);
            #endregion

            #region B One -> 18
            wvAbstract = new AbstractItem(E_ItemType.B, E_ItemKind.TROUSERS);
            wvProperty = new ItemGraficalProperty();
            wvProperty.SetContent(E_PropertiesKind.COLOR, E_Color.BLUE);
            wvAbstract.AddProperty(wvProperty);

            wvProperty = new ItemGraficalProperty();
            wvProperty.SetContent(E_PropertiesKind.GRADIATION, E_Gradiation.LIGHT);
            wvAbstract.AddProperty(wvProperty);

            wvProperty = new ItemGraficalProperty();
            wvProperty.SetContent(E_PropertiesKind.TEXTURE, E_Texture.PLAINCOLOR);
            wvAbstract.AddProperty(wvProperty);

            wvItems.Add(GetItem(wvAbstract, E_Items.BOne));
            #endregion

            wvRooms.Add(new Room(E_RoomsName.LIVINGROOM, wvItems));
            #endregion

            #region Room = KITCHEN
            wvItems = new List<Item>();

            #region A Two -> 71
            wvAbstract = new AbstractItem(E_ItemType.A, E_ItemKind.HAT);
            wvProperty = new ItemGraficalProperty();
            wvProperty.SetContent(E_PropertiesKind.COLOR, E_Color.GREEN);
            wvAbstract.AddProperty(wvProperty);

            wvProperty = new ItemGraficalProperty();
            wvProperty.SetContent(E_PropertiesKind.GRADIATION, E_Gradiation.DARK);
            wvAbstract.AddProperty(wvProperty);

            wvProperty = new ItemGraficalProperty();
            wvProperty.SetContent(E_PropertiesKind.TEXTURE, E_Texture.STRIPES);
            wvAbstract.AddProperty(wvProperty);

            wvSolution.AddItem(wvAbstract);
            wvItems.Add(GetItem(wvAbstract, E_Items.ATwo));
            #endregion

            #region B Two  -> 68
            wvAbstract = new AbstractItem(E_ItemType.B, E_ItemKind.HAT);
            wvProperty = new ItemGraficalProperty();
            wvProperty.SetContent(E_PropertiesKind.COLOR, E_Color.GREEN);
            wvAbstract.AddProperty(wvProperty);

            wvProperty = new ItemGraficalProperty();
            wvProperty.SetContent(E_PropertiesKind.GRADIATION, E_Gradiation.DARK);
            wvAbstract.AddProperty(wvProperty);

            wvProperty = new ItemGraficalProperty();
            wvProperty.SetContent(E_PropertiesKind.TEXTURE, E_Texture.POIS);
            wvAbstract.AddProperty(wvProperty);

            wvItems.Add(GetItem(wvAbstract, E_Items.BTwo));
            #endregion

            wvRooms.Add(new Room(E_RoomsName.KITCHEN, wvItems));
            #endregion

            #region Room = BEDROOM
            wvItems = new List<Item>();

            #region A Three  -> 127
            wvAbstract = new AbstractItem(E_ItemType.A, E_ItemKind.T_SHIRT);
//.........这里部分代码省略.........
开发者ID:Amebus,项目名称:KillersWearsPrada,代码行数:101,代码来源:DBHelper.cs

示例2: CreateGame

        /// <summary>
        /// Generate a list of <see cref="Item,"/> to be put in a <see cref="Room"/>
        /// </summary>
        /// <param name="NumberOfItems"></param>
        /// <returns></returns>
        private Game CreateGame(string ID, string PalyerName,int NumberOfItems)
        {
            Solution wvSolution = new Solution();
            List<Room> wvRooms = new List<Room>();

            wvRooms.Add(new Room(E_RoomsName.START_ROOM));

            for (int i = 1; i <= NUMBER_OF_ROOMS_WITH_ITEMS; i++)
            {
                AbstractItem wvCorrectAbstractItem = GenerateCorrectAbstractItem((E_ItemKind._NULL + i));
                Item wvCorrectItem = attDataBase.GetItemFromAbstractItem(wvCorrectAbstractItem);

                wvSolution.AddItem(wvCorrectItem);

                wvRooms.Add(GenerateRoom((E_RoomsName)(i+1), wvCorrectItem));

            }

            return new Game(ID, PalyerName, wvRooms, wvSolution);
        }
开发者ID:Amebus,项目名称:KillersWearsPrada,代码行数:25,代码来源:GameController.cs


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