Esempio n. 1
0
        public override Boolean Equals(Object punkt)
        {
            if (null == punkt || !(punkt is Trafienie))
            {
                return(false);
            }

            Trafienie innyp = punkt as Trafienie;

            return(innyp.Lokalizacja.Equals(Lokalizacja));
        }
Esempio n. 2
0
        public Boolean JestSukces(Point point)
        {
            if (null == Points)
            {
                throw new Exception("Boat is not setup.");
            }

            Trafienie HitPoint = Points.FirstOrDefault((aPoint) => { return(aPoint.Lokalizacja.X == point.X && aPoint.Lokalizacja.Y == point.Y); });

            if (HitPoint != null)
            {
                if (HitPoint.Hit)
                {
                    throw new Exception("Point was already hit.");
                }

                HitPoint.Hit = true;
                return(true);
            }

            return(false);
        }