public Coordinate(int Yaxis, int Xaxis, EnumCoordinateType coordinateType) { this.Yaxis = Yaxis; this.Xaxis = Xaxis; CoordinateType = coordinateType; Direction = EnumHarbourDirection.none; }
public Coordinate(int Yaxis, int Xaxis, EnumCoordinateType coordinateType, EnumHarbourDirection direction) { this.Yaxis = Yaxis; this.Xaxis = Xaxis; CoordinateType = coordinateType; Direction = direction; }
/// <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); }
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); }
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); }
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); }