public void Matrix() { try { dt = new DataTable(); dt = getLevel.Copy(); for (int j = 0; j < getmenu.Rows.Count; j++) { dt.Columns.Add(new DataColumn(getmenu.Rows[j][1].ToString(), typeof(bool))); } GridMatrix.DataSource = dt; GridMatrix.DataBind(); //For Hiding Profile Level Value From Grid GridMatrix.HeaderRow.Cells[1].Visible = false; foreach (GridViewRow gvr in GridMatrix.Rows) { gvr.Cells[1].Visible = false; } } catch (Exception ex) { lblmsg.Text = ex.Message; } }
static void Main(string[] args) { Grid a = new Grid(); Grid b = new Grid(); GridArea area = new GridArea(a, b); area.Start.X = 5; area.Start.Y = 5; area.End.X = -1; area.End.Y = -1; GridMatrix <Grid> g = new GridMatrix <Grid>(); g.AddElement(a); g.AddElement(b); bool addDuplicate = g.AddElement(a); g.RemoveElement(a); g.GetArea(); GridArea size = g.GetArea(); bool hasGrid = g.HasElement(new Grid()); System.Console.WriteLine("Press any key to exit"); System.Console.ReadKey(); }
public override void GenerateContent() { base.GenerateContent(); Generator gen = new Generator(); IntPair roomSize = InnerDimensions; IntPair[] exits = new IntPair[ExitCount]; int count = 0; for (int i = 0; i < ChunkCoords.DIRECTION_COUNT; i++) { Direction dir = (Direction)i; if (HasExit(dir)) { bool vertical = dir.IsVertical(); IntPair exitPos = GetExitPos(dir); IntPair adjustedExitPos = exitPos; //left, right IntPair horizontalBoundaries = HorizontalBoundaries; horizontalBoundaries.y -= (ExitWidth - 1); //down, up IntPair verticalBoundaries = VerticalBoundaries; verticalBoundaries.y -= (ExitWidth - 1); adjustedExitPos.x = Mathf.Clamp(adjustedExitPos.x, horizontalBoundaries.x, horizontalBoundaries.y); adjustedExitPos.y = Mathf.Clamp(adjustedExitPos.y, verticalBoundaries.x, verticalBoundaries.y); exits[count] = adjustedExitPos; count++; } } maze = gen.GeneratePuzzle(roomSize, exits, ExitWidth); List <IntPair> path = maze.GetLongestPath(); idealLootPosition = path != null ? path[path.Count - 1] : exits[0]; SetUpLoot(); for (int x = 1; x < maze.GetSize().x - 1; x++) { for (int y = 1; y < maze.GetSize().y - 1; y++) { IntPair tilePos = new IntPair(x, y); int index = maze.Index(x, y); bool wall = maze.Get(index); AddTile(tilePos, wall ? DungeonRoomTileType.Wall : DungeonRoomTileType.Floor); } } }
protected void GridMatrix_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { LinkButton lbSave = (LinkButton)GridMatrix.FindControl("linkbtnSave"); if (lbSave != null) { lbSave.Visible = false; } else { return; } } }
public void playToGridCube(GridMatrix gm, Transform cube) { Vector2 gridPos = gm.worldToGrid(cube.position); if (rank == Rank.Conduit) { GridBox newArea = new GridBox(new Vector2(cube.position.x, cube.position.z), new Vector2(range, range)); gm.AddToPlayersCastArea(newArea); } transform.parent = cube; transform.Find("Model").gameObject.SetActive(true); transform.localPosition = new Vector3(0, 0, 0); transform.Find("Model").localPosition = new Vector3(0, 1, 0); transform.Find("card 1").gameObject.SetActive(false); Debug.Log("played card"); played = true; }
public override void GenerateContent() { base.GenerateContent(); Generator gen = new Generator(); int padding = 1; int minimumSolutionCount = 1; puzzle = gen.Generate(PuzzleSize, padding, minimumSolutionCount); puzzle.OnPuzzleCompleted += UnlockAllExitsOfLockTypeNone; Debug.Log(puzzle.GridSize); IntPair offset = IntPair.one; int tileSize = ExitWidth; for (int i = 0; i < puzzle.grid.Length; i++) { IntPair puzzlePos = puzzle.GetPositionFromIndex(i); bool isBlock = puzzle.BlockExists(puzzlePos); if (!isBlock) { continue; } DungeonRoomObject roomBlock = new DungeonRoomObject( this, puzzlePos * tileSize + offset, "PushableBlock", puzzlePos, false); roomObjects.Add(roomBlock); } DungeonRoomObject finishButton = new DungeonRoomObject(this, puzzle.finishTile * tileSize + offset, "GreenButton", (Action)puzzle.CompletePuzzle, false); roomObjects.Add(finishButton); for (int i = 0; i < puzzle.resetTiles.Length; i++) { DungeonRoomObject resetButton = new DungeonRoomObject(this, puzzle.resetTiles[i] * tileSize + offset, "RedButton", (Action)puzzle.RevertLastChange, false); roomObjects.Add(resetButton); } LockAllExceptPreviousRoom(); }
public void Matrix() { try { dt = new DataTable(); dt = getLevel.Copy(); for (int j = 0; j < getmenu.Rows.Count; j++) { dt.Columns.Add(new DataColumn(getmenu.Rows[j][1].ToString(), typeof(bool))); } //dt.Columns["DEGREE CERTIFICATE"].ColumnName = "DEGREE"; //dt.Columns["PROVISIONAL DEGREE CERTIFICATE"].ColumnName = "PROVISIONAL DEGREE"; //dt.Columns["PASSING CERTIFICATE"].ColumnName = "PASSING"; //dt.Columns["MERIT CERTIFICATE"].ColumnName = "MERIT"; //dt.Columns["ATTEMPT CERTIFICATE"].ColumnName = "ATTEMPT"; //dt.Columns["MEDAL CERTIFICATE"].ColumnName = "MEDAL"; //dt.Columns["DUPLICATE MARKSHEET"].ColumnName = "DUPLICATE"; //dt.Columns["MARKSHEET VERIFICATION CERTIFICATE / LETTER"].ColumnName = "MARKSHEET VERIFICATION"; //dt.Columns["DEGREE VERIFICATION CERTIFICATE / LETTER"].ColumnName = "DEGREE VERIFICATION"; //dt.Columns["DATE OF DECLARATION CERTIFICATE / LETTER"].ColumnName = "DATE OF DECLARATION "; //dt.Columns["MEDIUM OF INSTRUCTION CERTIFICATE / LETTER"].ColumnName = "MEDIUM OF INSTRUCTION"; GridMatrix.DataSource = dt; GridMatrix.DataBind(); //For Hiding Profile Level Value From Grid GridMatrix.HeaderRow.Cells[1].Visible = false; foreach (GridViewRow gvr in GridMatrix.Rows) { gvr.Cells[1].Visible = false; gvr.Cells[2].Width = 150; } } catch (Exception ex) { lblmsg.Text = ex.Message; } }
public override void GenerateContent() { base.GenerateContent(); Generator gen = new Generator(); puzzleGrid = gen.GeneratePuzzle(puzzleGrid.GridSize, (int)puzzleDifficulty); IntPair offset = new IntPair(RoomWidth / 2 - puzzleGrid.GridSize.x / 2, RoomHeight / 2 - puzzleGrid.GridSize.y / 2); for (int i = 0; i < puzzleGrid.GetArrayLength(); i++) { IntPair pos = puzzleGrid.GetPosition(i); bool flipped = puzzleGrid.IsFlipped(i); DungeonRoomObject tileLight = new DungeonRoomObject(this, pos + offset, "FlipTile", i, false); roomObjects.Add(tileLight); } }
public void CreatePanel(GameObject pnl, GridMatrix gm) { if (panel == null) { panel = PhotonNetwork.Instantiate("panel", pnl.transform.position, Quaternion.identity, 0); panel.transform.localScale = new Vector3(panel.transform.localScale.x * (2 * size.x + 1), panel.transform.localScale.y * (2 * size.y + 1), 1); panel.transform.SetParent(pnl.transform.parent, false); //panel.transform.eulerAngles = new Vector3(0,0,0); //panel.transform.localPosition = new Vector3(panel.transform.localPosition.x,panel.transform.localPosition.y,0); //RectTransform rt = panel.GetComponent<RectTransform>(); panel.transform.position = new Vector3(center.x, pnl.transform.position.y, center.y); //panel.transform.localPosition = new Vector3(panel.transform.position.x,panel.transform.position.y,0); //rt.eulerAngles = new Vector3(-90,180,180); //Debug.Log("gridbox is " + min + " to " + max); //new Vector2(-20.5f + min.x * 2.05f,-10.6f + min.y * 1.7625f)); //Debug.Log(rt.rect.height+ " " + height); index++; } //rt.SetSize(size); }
public TileFlipPuzzleRoom(IntPair position, DungeonRoom previousRoom) : base(position, previousRoom) { puzzleGrid = CreateNewGridMatrix(); }
public void playToGrid(GridMatrix gm, Vector2 gridpos) { }
public void playToGridWorld(GridMatrix gm, Player p, Vector3 worldpos) { Vector2 gridPos = gm.worldToGrid(new Vector3(worldpos.x, worldpos.z)); }
protected void GridMatrix_DataBind() { GridMatrix.DataBind(); }