Example #1
0
        private DisplayStatue[] GetStatues()
        {
            if (Statues == null || Statues.Length != 3)
            {
                Statues = new DisplayStatue[3];
            }

            for (int i = 0; i < 3; i++)
            {
                if (Statues[i] == null || Statues[i].Deleted)
                {
                    DisplayStatue s = this.GetEnumeratedItems().OfType <DisplayStatue>().FirstOrDefault(st => Array.IndexOf(Statues, st) == -1);

                    if (s == null)
                    {
                        Statues[i]         = new DisplayStatue();
                        Statues[i].Movable = false;
                        Statues[i].MoveToWorld(_StatueLocs[i], Map.Malas);
                    }
                    else
                    {
                        Statues[i] = s;
                        Statues[i].MoveToWorld(_StatueLocs[i], Map.Malas);
                    }
                }
            }

            return(Statues);
        }
Example #2
0
        public void ChangeStatues()
        {
            var statues = GetStatues();

            for (var index = 0; index < statues.Length; index++)
            {
                DisplayStatue statue = statues[index];

                statue.AssignRandom();
            }
        }
Example #3
0
        private DisplayStatue[] GetStatues()
        {
            if (Statues == null || Statues.Length != 3)
            {
                Statues = new DisplayStatue[3];
            }

            for (int i = 0; i < 3; i++)
            {
                if (Statues[i] == null || Statues[i].Deleted)
                {
                    DisplayStatue s = null;

                    foreach (Item item in GetEnumeratedItems())
                    {
                        if (item is DisplayStatue st && Array.IndexOf(Statues, st) == -1)
                        {
                            s = st;
                            break;
                        }
                    }

                    if (s == null)
                    {
                        Statues[i] = new DisplayStatue
                        {
                            Movable = false
                        };
                        Statues[i].MoveToWorld(_StatueLocs[i], Map.Malas);
                    }
                    else
                    {
                        Statues[i] = s;
                        Statues[i].MoveToWorld(_StatueLocs[i], Map.Malas);
                    }
                }
            }

            return(Statues);
        }