public SegmentProxy(int segmentId)
 {
     _segmentId = segmentId;
     for (int sideNum = 0; sideNum < Segment.NumSides; sideNum++)
     {
         Sides.Add(new Side(Segment, sideNum));
     }
 }
示例#2
0
            public DungeonNode(Container container)
            {
                this.Container = container;

                Sides.Add(EntranceSide.Top, new List <Wall>());
                Sides.Add(EntranceSide.Bottom, new List <Wall>());
                Sides.Add(EntranceSide.Left, new List <Wall>());
                Sides.Add(EntranceSide.Right, new List <Wall>());
            }
示例#3
0
        public void InitializeCharacters(string playerId, TeamData teamData, bool isTestMode = false)
        {
            teamData.Characters.ForEach(character =>
            {
                var cloneCharacter = Convert.Clone(character);
                cloneCharacter.InitializeDeckForBattle();
                cloneCharacter.ResetTurn();

                if (isTestMode)
                {
                    cloneCharacter.OwnerPlayerId = playerId;                        // Change player ID in test mode
                }
                Characters.Add(cloneCharacter);
            });

            var currentSide = Sides.Keys.Count == 0 ? CharacterSide.Spaghetti : CharacterSide.Unicorn;

            Sides.Add(playerId, currentSide);
        }
示例#4
0
 public void AddSide(float Side)
 {
     Sides.Add(Side);
     Perimeter = CalculatePerimeter();
 }
        /// <summary>
        /// This is the OnGet method for the data model. This handles what to do when the client tries to get data from the website.
        /// </summary>
        /// <param name="Terms">The search terms that were sent by the client.</param>
        /// <param name="CaloriesMin">The minimum caloires that was sent by the client.</param>
        /// <param name="CaloriesMax">The maximum calories that was sent by the client.</param>
        /// <param name="PriceMin">The minimum price that was sent by the client.</param>
        /// <param name="PriceMax">The maximum price that was sent by the client.</param>
        /// <param name="ShowEntrees">Whether or not to show the entrees tab as sent by the client.</param>
        /// <param name="ShowDrinks">Whether or not to show the drinks tab as sent by the client.</param>
        /// <param name="ShowSides">Whether or not to show the sides tab as sent by the client.</param>
        public void OnGet(string Terms, uint?CaloriesMin, uint?CaloriesMax, double?PriceMin, double?PriceMax, bool ShowEntrees, bool ShowDrinks, bool ShowSides)
        {
            this.Terms       = Terms;
            this.CaloriesMin = CaloriesMin;
            this.CaloriesMax = CaloriesMax;
            this.PriceMin    = PriceMin;
            this.PriceMax    = PriceMax;

            //Since the request only contains the key if they are checked, and only time query count is 0 is on first load to prevent from auto-disabling.
            if (Request.Query.Count != 0)
            {
                this.ShowEntrees = Request.Query.ContainsKey("ShowEntrees");
                this.ShowDrinks  = Request.Query.ContainsKey("ShowDrinks");
                this.ShowSides   = Request.Query.ContainsKey("ShowSides");
            }

            //Add all items to the bases here.
            if (this.ShowEntrees)
            {
                Entrees = Menu.Entrees();
                Entrees = Menu.FilterByCalories(Entrees, CaloriesMin, CaloriesMax);
                Entrees = Menu.FilterByPrice(Entrees, PriceMin, PriceMax);
                Entrees = Menu.Search(Entrees, Terms);
            }

            Dictionary <string, List <IOrderItem> > TempDrinks = new Dictionary <string, List <IOrderItem> >();
            Dictionary <string, List <IOrderItem> > TempSides  = new Dictionary <string, List <IOrderItem> >();

            //Drinks
            if (this.ShowDrinks)
            {
                //Generate a temp dictionary of all possible drink items.
                foreach (IOrderItem drink in Menu.Drinks())
                {
                    List <IOrderItem> res;
                    string            key = "";
                    if (drink is SailorSoda)
                    {
                        key = drink.ItemName.Substring(drink.ItemName.IndexOf(" ") + 1 + drink.ItemName.Substring(drink.ItemName.IndexOf(" ") + 1).IndexOf(" ") + 1);
                    }
                    else
                    {
                        key = drink.ItemName.Substring(drink.ItemName.IndexOf(" ") + 1);
                    }

                    if (TempDrinks.TryGetValue(key, out res))
                    {
                        //Handle the multiple types of Sailor Soda
                        if (res.Count != Enum.GetNames(typeof(Size)).Length)
                        {
                            res.Add(drink);
                        }
                    }
                    else
                    {
                        List <IOrderItem> t = new List <IOrderItem>();
                        t.Add(drink);
                        TempDrinks.Add(key, t);
                    }
                }
                //Filter the items from the temp drinks dictionary and add the ones that make it through the filters into the real drinks dictionary.
                foreach (string key in TempDrinks.Keys)
                {
                    List <IOrderItem> outList;
                    if (TempDrinks.TryGetValue(key, out outList))
                    {
                        outList = Menu.FilterByCalories(outList, CaloriesMin, CaloriesMax).ToList();
                        outList = Menu.FilterByPrice(outList, PriceMin, PriceMax).ToList();
                        outList = Menu.Search(outList, Terms).ToList();
                        if (outList.Count != 0)
                        {
                            Drinks.Add(key, outList);
                        }
                    }
                }
            }

            //Sides
            if (this.ShowSides)
            {
                //Generate a temp dictionary of all possible side items.
                foreach (IOrderItem side in Menu.Sides())
                {
                    List <IOrderItem> res;
                    string            key = side.ItemName.Substring(side.ItemName.IndexOf(" ") + 1);
                    if (TempSides.TryGetValue(key, out res))
                    {
                        res.Add(side);
                    }
                    else
                    {
                        List <IOrderItem> t = new List <IOrderItem>();
                        t.Add(side);
                        TempSides.Add(key, t);
                    }
                }
                //Filter the items from the temp drinks dictionary and add the ones that make it through the filters into the real sides dictionary.
                foreach (string key in TempSides.Keys)
                {
                    List <IOrderItem> outList;
                    if (TempSides.TryGetValue(key, out outList))
                    {
                        outList = Menu.FilterByCalories(outList, CaloriesMin, CaloriesMax).ToList();
                        outList = Menu.FilterByPrice(outList, PriceMin, PriceMax).ToList();
                        outList = Menu.Search(outList, Terms).ToList();
                        if (outList.Count != 0)
                        {
                            Sides.Add(key, outList);
                        }
                    }
                }
            }
        }
示例#6
0
 public void SetSide(EnumDirection direction, MapSite mapSite)
 {
     Sides.Add(mapSite);
 }