示例#1
0
 public Coordinate(int Yaxis, int Xaxis, EnumCoordinateType coordinateType)
 {
     this.Yaxis     = Yaxis;
     this.Xaxis     = Xaxis;
     CoordinateType = coordinateType;
     Direction      = EnumHarbourDirection.none;
 }
示例#2
0
 public Coordinate(int Yaxis, int Xaxis, EnumCoordinateType coordinateType, EnumHarbourDirection direction)
 {
     this.Yaxis     = Yaxis;
     this.Xaxis     = Xaxis;
     CoordinateType = coordinateType;
     Direction      = direction;
 }
示例#3
0
        /// <summary>
        /// Gets one tile, and removes it from its total list.
        /// </summary>
        /// <returns></returns>
        public ITileType GetOneRandomTileTypeOfTypeSort(EnumCoordinateType typeSort)
        {
            IList <ITileType> sortedListTileType = GetListTileTypesOfTypeSort(typeSort);
            Random            R    = new Random();
            int       randomnumber = R.Next(0, sortedListTileType.Count - 1);
            ITileType result       = sortedListTileType[randomnumber];

            RemoveTile(result);
            return(result);
        }
示例#4
0
        public List <Coordinate> GetListCoordinates(EnumCoordinateType type)
        {
            List <Coordinate> LandCoordinates = new List <Coordinate>();

            foreach (Coordinate coordinate in coords)
            {
                if (coordinate.CoordinateType == type)
                {
                    LandCoordinates.Add(coordinate);
                }
            }
            return(LandCoordinates);
        }
示例#5
0
        public IList <ITileType> GetListTileTypesOfTypeSort(EnumCoordinateType typeSort)
        {
            List <ITileType> resultTileTypeList = new List <ITileType>();

            foreach (ITileType tileTypeInList in Tiletypes)
            {
                if (tileTypeInList.TypeSort == typeSort)
                {
                    resultTileTypeList.Add(tileTypeInList);
                }
            }
            return(resultTileTypeList);
        }
示例#6
0
        public Coordinate GetOneRandomCoordinate(EnumCoordinateType type)
        {
            Random random = new Random();

            Shuffler          shuffle = new Shuffler();
            List <Coordinate> list    = GetListCoordinates(type);
            Coordinate        result  = null;

            shuffle.Shuffle(list);
            foreach (Coordinate coord in list)
            {
                coords.Remove(coord);
                result = coord;
                break;
            }
            return(result);
        }