////////////////////////////////////////////////////////////////////////////////// ////////////////////Debug///////////////////////////////////////////////////////// private void drawDebug() { List <string> debugInfo = new List <string>(); if (getMouseToMapCoord().x >= 0 && getMouseToMapCoord().x < mapSize.x && getMouseToMapCoord().y >= 0 && getMouseToMapCoord().y < mapSize.y) { BoardCollection boardHoverover = map[getMouseToMapCoord().x, getMouseToMapCoord().y]; debugInfo.Add("Mouse Rel Pos :" + Input.mousePosition.ToString()); debugInfo.Add("Mouse Rel Pos :" + getMouseToMapCoord().ToString()); debugInfo.Add("Biome ID : " + boardHoverover.BiomeID.ToString()); debugInfo.Add("Connected To Other Biome : " + boardHoverover.ConnectedToOther.ToString()); debugInfo.Add("Edge of the world : " + boardHoverover.OuterShell.ToString()); debugInfo.Add("Is Entrance : " + boardHoverover.DoorWay.ToString()); debugInfo.Add("Wall top : " + boardHoverover.TopWall.ToString()); debugInfo.Add("Wall bot: " + boardHoverover.BottomWall.ToString()); debugInfo.Add("Wall left: " + boardHoverover.LeftWall.ToString()); debugInfo.Add("Wall right: " + boardHoverover.RightWall.ToString()); debugInfo.Add("Type: " + boardHoverover.RType.ToString()); debugInfo.Add("Orientation: " + boardHoverover.OrType.ToString()); debugInfo.Add("Walls : " + boardHoverover.getWallCount().ToString()); } for (int i = 0; i < debugInfo.Count; i++) { GUI.Label(new Rect((int)Input.mousePosition.x, Screen.height - (int)Input.mousePosition.y + 20 * i, 200, 200), "Mouse Rel Pos :" + debugInfo[i], debugStyle); } GUI.Label(new Rect(0, 0, 1000, 20), "Connecting Biome 1 ID : " + bio1, debugStyle); for (int i = 0; i < biomeActions.connections.Count; i++) { int[] con = biomeActions.connections[i]; GUI.Label(new Rect(0, 20 * (1 + i), 1000, 20), "Biome :" + con[0] + " connected to biome :" + con[1], debugStyle); } }
public MemberContext(string id, bool isMe, TrelloAuthorization auth) : base(auth) { Data.Id = id; Actions = new ReadOnlyActionCollection(typeof(Member), () => Data.Id, auth); if (isMe) { Boards = new BoardCollection(typeof(Member), () => Data.Id, auth); BoardBackgrounds = new BoardBackgroundCollection(() => Data.Id, auth); Organizations = new OrganizationCollection(() => Data.Id, auth); StarredBoards = new StarredBoardCollection(() => Data.Id, auth); } else { Boards = new ReadOnlyBoardCollection(typeof(Member), () => Data.Id, auth); BoardBackgrounds = new ReadOnlyBoardBackgroundCollection(() => Data.Id, auth); Organizations = new ReadOnlyOrganizationCollection(() => Data.Id, auth); StarredBoards = new ReadOnlyStarredBoardCollection(() => Data.Id, auth); } Boards.Refreshed += (s, e) => OnMerged(new[] { nameof(Boards) }); BoardBackgrounds.Refreshed += (s, e) => OnMerged(new[] { nameof(BoardBackgrounds) }); Organizations.Refreshed += (s, e) => OnMerged(new[] { nameof(Organizations) }); StarredBoards.Refreshed += (s, e) => OnMerged(new[] { nameof(StarredBoards) }); Cards = new ReadOnlyCardCollection(EntityRequestType.Member_Read_Cards, () => Data.Id, auth); Cards.Refreshed += (s, e) => OnMerged(new[] { nameof(Cards) }); Notifications = new ReadOnlyNotificationCollection(() => Data.Id, auth); Notifications.Refreshed += (s, e) => OnMerged(new[] { nameof(Notifications) }); MemberPreferencesContext = new MemberPreferencesContext(Auth); MemberPreferencesContext.SubmitRequested += ct => HandleSubmitRequested("Preferences", ct); Data.Prefs = MemberPreferencesContext.Data; }
private void init() { map = new BoardCollection[mapSize.x, mapSize.y]; for (int x = 0; x < mapSize.x; x++) { for (int y = 0; y < mapSize.y; y++) { map[x, y] = new BoardCollection(); map[x, y].Init(textureWidth / mapSize.x, textureHeight / mapSize.y); } } biomeGen.init(biomeCount + 1); biomeActions.init(); biomeGen.placeBiomeStarts(map); DataInitalised = true; if (!showGeneration) { biomeGen.growBiomeAll(map); biomeGen.setBaseBiomeColor(map); traitGen.traitMarkBiome(map); newWallGen.wallOffBiomes(map); } }
public OrganizationContext(string id, TrelloAuthorization auth) : base(auth) { Data.Id = id; Actions = new ReadOnlyActionCollection(typeof(Organization), () => Data.Id, auth); Actions.Refreshed += (s, e) => OnMerged(new List <string> { nameof(Actions) }); Boards = new BoardCollection(typeof(Organization), () => Data.Id, auth); Boards.Refreshed += (s, e) => OnMerged(new List <string> { nameof(Boards) }); Members = new ReadOnlyMemberCollection(EntityRequestType.Organization_Read_Members, () => Data.Id, auth); Members.Refreshed += (s, e) => OnMerged(new List <string> { nameof(Members) }); Memberships = new OrganizationMembershipCollection(() => Data.Id, auth); Memberships.Refreshed += (s, e) => OnMerged(new List <string> { nameof(Memberships) }); PowerUpData = new ReadOnlyPowerUpDataCollection(EntityRequestType.Organization_Read_PowerUpData, () => Data.Id, auth); PowerUpData.Refreshed += (s, e) => OnMerged(new List <string> { nameof(PowerUpData) }); OrganizationPreferencesContext = new OrganizationPreferencesContext(Auth); OrganizationPreferencesContext.SubmitRequested += ct => HandleSubmitRequested("Preferences", ct); Data.Prefs = OrganizationPreferencesContext.Data; }
public static World FromJson(JToken jsonObject) { var world = new World((Guid)jsonObject["id"], jsonObject.Value <string>("name"), jsonObject.Value <uint>("engineVersion")); world._boards = BoardCollection <Board> .FromJson(x => Board.FromJson(world, x), jsonObject["boards"]); world.Player = jsonObject["player"].HasValues ? Player.FromJson(jsonObject["player"]) : null; return(world); }
public void GiveAObjWhenIsABoardCollectionThenReturnsTrue() { // Arrange SetupState(); var boardCollection = new BoardCollection(); // Act var isAppliable = state.IsAppliable(boardCollection); // Assert Assert.True(isAppliable); }
public void growBiome(BoardCollection[,] map) { BoardCollection[,] tempMap = new BoardCollection[map.GetLength(0), map.GetLength(1)]; for (int x = 0; x < map.GetLength(0); x++) { for (int y = 0; y < map.GetLength(1); y++) { tempMap[x, y] = new BoardCollection(); tempMap[x, y].BiomeID = map[x, y].BiomeID; tempMap[x, y].RType = BoardCollection.RoomType.Normal; } } for (int x = 0; x < map.GetLength(0); x++) { for (int y = 0; y < map.GetLength(1); y++) { if (tempMap[x, y].BiomeID != 0) { if (x > 0) { if (tempMap[x - 1, y].BiomeID == 0) { map[x - 1, y].BiomeID = expandChance(tempMap[x, y].BiomeID, 1); } } if (y > 0) { if (tempMap[x, y - 1].BiomeID == 0) { map[x, y - 1].BiomeID = expandChance(tempMap[x, y].BiomeID, 2); } } if (x < map.GetLength(1) - 1) { if (tempMap[x + 1, y].BiomeID == 0) { map[x + 1, y].BiomeID = expandChance(tempMap[x, y].BiomeID, 3); } } if (y < map.GetLength(1) - 1) { if (tempMap[x, y + 1].BiomeID == 0) { map[x, y + 1].BiomeID = expandChance(tempMap[x, y].BiomeID, 4); } } } } } }
public void GivenAObjWhenIsABoardCollectionThenSelfLinkAdded() { // Arrange SetupState(); mockLinkFactory.Setup(x => x.Build("BoardSearch", It.IsAny <object>())).Returns("http://fake-url/"); var boardCollection = new BoardCollection(); // Act state.Apply(boardCollection); // Assert Assert.NotNull(boardCollection.Links); Assert.NotNull(boardCollection.Links.FirstOrDefault(x => x.Rel == Link.SELF)); }
public void GivenAnObjectWhenIsABoardCollectionThenApplyBoardStatesToAllBoards() { // Arrange SetupState(); mockLinkFactory.Setup(x => x.Build("BoardSearch", It.IsAny <object>())).Returns("http://fake-url/"); var boardCollection = new BoardCollection { Items = new List <Board> { new Board() } }; // Act state.Apply(boardCollection); // Asset mockBoardState.Verify(x => x.Apply(It.IsAny <Board>()), Times.Once); }
public GameBoardCP(IEnumerable <SpaceInfoCP> previousList) { _privateBoard = new BoardCollection <SpaceInfoCP>(previousList); }
public XPuzzleCollection(IEnumerable <XPuzzleSpaceInfo> previousList) { _privateBoard = new BoardCollection <XPuzzleSpaceInfo>(previousList); FinishInit(); }
public PlayerBingo() { _privateBoard = new BoardCollection <BingoItem>(5, 5); Init(); }
public SequenceBoardCollection(IEnumerable <SpaceInfoCP> PreviousList) { _privateBoard = new BoardCollection <SpaceInfoCP>(PreviousList); _autoResume = true; }
public ConnectFourCollection() { _privateBoard = new BoardCollection <SpaceInfoCP>(6, 7); FinishInit(); }
public TicTacToeCollection() { _privateBoard = new BoardCollection <SpaceInfoCP>(3, 3); FinishInit(); }
public Category(string name , BoardCollection boards) { Name = name; Boards = boards; }
public SequenceBoardCollection() { _privateBoard = new BoardCollection <SpaceInfoCP>(6, 6); }
public ConnectFourCollection(IEnumerable <SpaceInfoCP> previousList) { _privateBoard = new BoardCollection <SpaceInfoCP>(previousList); FinishInit(); }
public BattleshipCollection() { _privateBoard = new BoardCollection <FieldInfoCP>(10, 10); //needs to be 10 by 10. }
public GameBoardCP() { _privateBoard = new BoardCollection <SpaceInfoCP>(6, 5); //because we have header. hopefully that works. }
public PlayerBingo(IEnumerable <BingoItem> previousList) { _privateBoard = new BoardCollection <BingoItem>(previousList); Init(); }
public XPuzzleCollection() { _privateBoard = new BoardCollection <XPuzzleSpaceInfo>(3, 3); FinishInit(); LoadBoard(); }