コード例 #1
0
ファイル: Ship.cs プロジェクト: cps-209-team-3/Graviton
        //This method deposits all of the orbs it can into a given well.
        public bool DepositOrbs(Well well)
        {
            bool completed = false;

            foreach (int orb in Orbs.ToList())
            {
                if (orb == well.Orbs)
                {
                    if (well.Orbs == 5)
                    {
                        completed = true;
                    }
                    else
                    {
                        well.Orbs++;
                    }
                    IncrementScore();
                    Orbs.Remove(orb);
                    well.TicksLeft = ParentGame.WellDestabFreq;
                }
            }
            return(completed);
        }
コード例 #2
0
        //This method deposits all of the orbs it can into a given well.
        public bool DepositOrbs(Well well)
        {
            bool completed = false;

            foreach (int orb in Orbs.ToList())
            {
                if (orb == well.Orbs && (!well.IsGhost || this == well.Owner))
                {
                    if (well.Orbs == 5)
                    {
                        completed = true;
                    }
                    well.Orbs++;
                    IncrementScore();
                    Orbs.Remove(orb);
                    well.TicksLeft = ParentGame.WellDestabFreq;
                }
            }
            if (well.Orbs == 6)
            {
                well.Orbs = 5;
            }
            return(completed);
        }