示例#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;
        }