예제 #1
0
        public ShipInstance(Position pos, Rotation r, Ship ship)
        {
            this.pos = pos;
            this.rotation = r;
            this.ship = ship;

            this.sunken = false;
        }
예제 #2
0
파일: Board.cs 프로젝트: ylt/Battleships
        public bool TestShipDuplicate(Ship ship)
        {
            //var results = from shipinst in ships where shipinst.ship == ship select shipinst;

            List<ShipInstance> results = ships.Where(x => x.ship == ship).ToList();
            if (results.Count > 0)
                return true;
            else
                return false;
        }