public override void Setup(GameMode gameMode) { base.Setup(gameMode); IsTopDown = false; var levelGrid = new ObjectGrid("levelGrid", this, 4, 3, 1920, 960); levelGrid.CanCollide = true; AddGridToLevelGrid(0, 0, levelGrid, new string[] { "19", "102", "103" }); AddGridToLevelGrid(1, 0, levelGrid, new string[] { "111", "43" }); AddGridToLevelGrid(2, 0, levelGrid, new string[] { "108", "109" }); AddGridToLevelGrid(0, 1, levelGrid, new string[] { "20", "39", "51" }); AddGridToLevelGrid(0, 2, levelGrid, new string[] { "21", "106" }); AddGridToLevelGrid(1, 2, levelGrid, new string[] { "104", "105" }); AddGridToLevelGrid(2, 2, levelGrid, new string[] { "95", "107" }); AddGridToLevelGrid(3, 2, levelGrid, new string[] { "110" }); Add(levelGrid); var teleporterback = new Teleporter("teleporter", this, "MainWorld", new Microsoft.Xna.Framework.Vector2(3456, 384)); teleporterback.Position = new Microsoft.Xna.Framework.Vector2(7296, 2688); teleporterback.BoundingBox = new Rectangle(0, 0, 96, 96); Add(teleporterback); var MinidungeonItem = new UpgradePickup("Damage150", this, new SpriteSheet("Textures/Items/Damage150"), "Increases damage by 150!"); MinidungeonItem.Position = new Vector2(7200, 2688); MinidungeonItem.Damage = 150; Add(MinidungeonItem); }
public override void Refresh() { base.Refresh(); //rebuild data grid Grid = new ObjectGrid(); Grid.DataSource = DataSource; Grid.DataBind(); //add New button IButton newRecord = Platform.Current.Create <IButton>(); newRecord.Text = Resources.Strings.OKHOSTING_ORM_UI_SelectController_New; newRecord.Click += NewRecord_Click; //create our own grid IGrid container = Platform.Current.Create <IGrid>(); container.ColumnCount = 1; container.RowCount = 2; container.SetContent(0, 0, Grid.Content); container.SetContent(1, 0, newRecord); Platform.Current.Page.Title = Resources.Strings.OKHOSTING_ORM_UI_SelectController_List + ' ' + Translator.Translate(DataSource.DataType.InnerType); Platform.Current.Page.Content = container; }
void Start() { grid = GameObject.Find("_ObjectGrid").GetComponent <ObjectGrid>(); floor = GameObject.Find("_FloorGrid").GetComponent <ProceduralGrid>(); //remove with removal of debugmode GameObject.Find("_AI").GetComponent <AIManager>().Add(this); startingPosition = new Vector3((int)transform.position.x, (int)transform.position.y, (int)transform.position.z); destination = new Vector3(10, 0, 10); }
public CheckDataSearchForm() { InitializeComponent(); _grid = new ObjectGrid <CheckData> { Dock = DockStyle.Fill }; _grid.Selection.SelectionMode = SourceGrid.GridSelectionMode.Row; radPanel1.Controls.Add(_grid); RefreshGrid(); }
public override void Place(Vector2Int mainCoords, ObjectGrid objectGrid) { Vector2Int pairCoords = mainCoords + GetPairOffset(); DoubleBarricade main = (DoubleBarricade)objectGrid.CreateCellObject(mainCoords, this); DoubleBarricade pair = (DoubleBarricade)objectGrid.CreateCellObject(pairCoords, pairPrefab); main.Pair = pair; main.Coords = mainCoords; pair.Pair = main; pair.Coords = pairCoords; }
public virtual bool CanPlace(Vector2Int coords, ObjectGrid objectGrid) { return(!objectGrid.CheckCell(coords) && !objectGrid.CheckCell(coords + new Vector2Int(1, 0)) && !objectGrid.CheckCell(coords + new Vector2Int(-1, 0)) && !objectGrid.CheckCell(coords + new Vector2Int(0, 1)) && !objectGrid.CheckCell(coords + new Vector2Int(0, -1)) && !objectGrid.CheckCell(coords + new Vector2Int(1, 1)) && !objectGrid.CheckCell(coords + new Vector2Int(-1, -1)) && !objectGrid.CheckCell(coords + new Vector2Int(1, -1)) && !objectGrid.CheckCell(coords + new Vector2Int(-1, 1))); }
public override void DeleteSelf(ObjectGrid objectGrid) { if (pair.alreadyDeleting) { base.DeleteSelf(objectGrid); } else { alreadyDeleting = true; objectGrid.DeleteCellObject(pair.Coords); base.DeleteSelf(objectGrid); } }
public CheckItemSelectForm(string lotid) { InitializeComponent(); sampleGrid = new ObjectGrid <CheckOrder>(); sampleGrid.Dock = DockStyle.Fill; radPanel1.Controls.Add(sampleGrid); sampleGrid.SelectedChanged += sampleGrid_SelectedChanged; sampleGrid.Selection.SelectionMode = SourceGrid.GridSelectionMode.Row; string clause = string.Format("lotid like '%{0}%' and ( sampleitemstate = {1} or sampleitemstate = {2})", lotid, (int)CheckOrderStateEnum.Complete, (int)CheckOrderStateEnum.Approve); var ec = Encode.EncodeData.GetDatas <CheckOrder>(clause, "sampleid desc", 20); sampleGrid.Fields = FieldSelectSettings <CheckOrder> .Instance.Fields.ToDescriptionList(); sampleGrid.Init(); sampleGrid.SetGrid(ec); }
public CheckDataCopyForm(EncodeCollection <CheckOrder> ec) { //test //order.SampleOrderState = SampleOrderStateEnum.Submit; _sampleOrder = ec[0]; InitializeComponent(); _sampleOrderGrid = new ObjectGrid <CheckOrder> { Dock = DockStyle.Fill }; _sampleOrderGrid.Fields = FieldSelectSettings <CheckOrder> .Instance.Fields.ToDescriptionList(); _sampleOrderGrid.Init(); panel1.Controls.Add(_sampleOrderGrid); _sampleOrderGrid.SetGrid(ec); _sampleOrderGrid.SelectedChanged += OnSampleSelectedChanged; //tsbSampleCount.Text = _sampleOrder.SampleQuantity.ToString(); //tsbNote.Text = _sampleOrder.Note; _sampleOrderGrid.SelectedRow = 0; LoadInfo(); }
protected override void OnLoad(EventArgs e) { foreach (Control ctrl in this.Controls) { if (ctrl is ComboBoxEx) { ComboBoxEx comb = (ComboBoxEx)ctrl; comb.DefineNewProc = new DeleDefineNewProc(ComboBoxDefineNewProc); comb.InitSource(); } } base.OnLoad(e); foreach (Control ctrl in this.Controls) { if (ctrl is ObjectGrid) { ObjectGrid objGrid = (ObjectGrid)ctrl; objGrid.ItemsChanged += new EventHandler <BrightIdeasSoftware.ItemsChangedEventArgs>(objGrid_ItemsChanged); } else if (ctrl is ComboBoxEx) { ComboBoxEx comb = (ComboBoxEx)ctrl; comb.SelectedValueChanged += new EventHandler(comb_SelectedIndexChanged); } else if (ctrl is TextBoxEx) { TextBoxEx txt = (TextBoxEx)ctrl; txt.TextChanged += new EventHandler(txt_TextChanged); } else if (ctrl is RichTextBoxEx) { RichTextBoxEx rtxt = (RichTextBoxEx)ctrl; rtxt.TextChanged += new EventHandler(rtxt_TextChanged); } } }
private void FindBlobsAndNeighbours() { var nblobs = ObjectGrid.Cast <int>().Distinct().Count(); var blobs = new List <Blob>(); for (int i = 0; i < nblobs; i++) { blobs.Add(new Blob()); } for (int y = 0; y < FieldHeight; y++) { for (int x = 0; x < FieldWidth; x++) { int blobId = ObjectGrid[x, y]; var blob = blobs[blobId]; if (blob.Id == -1) { blob.Id = blobId; } blob.Points.Add(new XY(x, y)); foreach (var neighbour in Neighbours(x, y)) { int neighbourBlobId = ObjectGrid[neighbour.X, neighbour.Y]; // Add neighbour if not yet found if (ObjectGrid[neighbour.X, neighbour.Y] != blobId && !blob.Neighbours.Contains(neighbourBlobId)) { blob.Neighbours.Add(neighbourBlobId); } } } } Blobs = blobs; }
private void DrawObject() { ObjectGrid.ColumnDefinitions.Clear(); ObjectGrid.RowDefinitions.Clear(); ObjectGrid.Children.Clear(); var MM_WH = new MyTools.C_MinMaxWidthHeight(250, Wrap: true, MinMaxName: 140); ObjectGrid.SetRowFromGrid(MyTools.GL_Auto); ObjectGrid.SetFromGrid(this.selectionWell.Well.GetEditor ( SFE, new MyTools.C_DefColumn(C.Well.Number, MM_WH, false) )); ObjectGrid.SetRowFromGrid(MyTools.GL_Auto); ObjectGrid.SetFromGrid(this.selectionWell.Well.GetEditor ( SFE, new MyTools.C_DefColumn(C.SelectionWell.DateTime, MM_WH, false) )); ObjectGrid.SetRowFromGrid(MyTools.GL_Auto); ObjectGrid.SetFromGrid(obj.Client.Detail.GetEditor ( SFE, new MyTools.C_DefColumn(C.DetailsClient.FullName, MM_WH, false) )); ObjectGrid.SetRowFromGrid(MyTools.GL_Auto); ObjectGrid.SetFromGrid(obj.GetEditor ( SFE, new MyTools.C_DefColumn(C.Objecte.AdresFact, MM_WH, false), new MyTools.C_DefColumn(C.Objecte.NumberFolder, MM_WH, false) )); //нужно пихнуть объёмы }
private void MapItem() { var sel = Selection.Count; var MapSelected = ObjectGrid.GetSelectedFieldValues("objectid", "n_objectid", "Latitude", "Longitude", "description", "Area", "AssetNumber", "LocationID"); if (sel > 0 || MapSelected.Count > 0) { if (HttpContext.Current.Session["MapSelected"] != null) { //Remove Value HttpContext.Current.Session.Remove("MapSelected"); } if (MapSelected.Count > 0) { HttpContext.Current.Session.Add("MapSelected", MapSelected); } //Check For Row Value In Hidden Field (Set Via JS) if (Selection.Contains("n_objectid") && MapSelected.Count < 1) { //Check For Previous Session n_objectid if (HttpContext.Current.Session["n_objectid"] != null) { //Remove Value HttpContext.Current.Session.Remove("n_objectid"); } //Add Session N_objectid HttpContext.Current.Session.Add("n_objectid", Selection.Get("n_objectid")); //Check for previous session object ID if (HttpContext.Current.Session["objectid"] != null) { //Remove Value HttpContext.Current.Session.Remove("objectid"); } //Add session object ID HttpContext.Current.Session.Add("objectid", Selection.Get("objectid")); //Check For Previous Session Latitude if (HttpContext.Current.Session["Latitude"] != null) { //Remove Value HttpContext.Current.Session.Remove("Latitude"); } //Add Session Latitude HttpContext.Current.Session.Add("Latitude", Selection.Get("Latitude")); //Check For Previous Session Longitude if (HttpContext.Current.Session["Longitude"] != null) { //Remove Value HttpContext.Current.Session.Remove("Longitude"); } //Add Session Longitude HttpContext.Current.Session.Add("Longitude", Selection.Get("Longitude")); //Check for previous session object description if (HttpContext.Current.Session["description"] != null) { //Remove Value HttpContext.Current.Session.Remove("description"); } //Add session object description HttpContext.Current.Session.Add("objectDescription", Selection.Get("description")); //Check for Previous Session Object Area if (Session["Area"] != null) { Session.Remove("Area"); } Session.Add("Area", Selection.Get("Area")); //Check for previous Session Object Asset number if (Session["AssetNumber"] != null) { Session.Remove("AssetNumber"); } Session.Add("AssetNumber", Selection.Get("AssetNumber")); //Check for previous Session Object Location if (Session["LocationID"] != null) { Session.Remove("LocationID"); } Session.Add("LocationID", Selection.Get("LocationID")); } //Redirect To Report Page Response.Redirect("~/Pages/Map/MapForm.aspx", true); } else { HttpContext.Current.Response.Write("<script language='javascript'>alert('Error trying to Map Items, No rows were selected.');</script>"); }; }
public void Place(Vector3 screenPos, ObjectGrid objectGrid) { Place(objectGrid.GetCoords(screenPos), objectGrid); }
public virtual void Place(Vector2Int coords, ObjectGrid objectGrid) { objectGrid.CreateCellObject(coords, this); }
public virtual void DeleteSelf(ObjectGrid objectGrid) { Object.Destroy(this.gameObject); }
/// <summary> /// Deletes Selected Row /// </summary> private void DeleteSelectedRow() { //Check Permissions if (_userCanDelete) { //Create Deletion Bool var deletionDone = false; //Create Deltion Continue Bool bool continueDeletion; //Create Deletion Key var recordToDelete = -1; //Check For Multi Selection if ((ObjectGrid.Columns[0].Visible)) { //Get Selections var recordIdSelection = ObjectGrid.GetSelectedFieldValues("n_taskid"); //Process Multi Selection foreach (var record in recordIdSelection) { //Get ID recordToDelete = Convert.ToInt32(record.ToString()); //Set Continue Bool continueDeletion = (recordToDelete > 0); //Check Continue Bool if (continueDeletion) { //Clear Errors _oMaintenanceObject.ClearErrors(); //Delete Jobstep if (_oMaintenanceObject.Delete(recordToDelete)) { //Set Deletion Done deletionDone = true; } } //Check Deletion Done if (deletionDone) { //Perform Refresh ObjectGrid.DataBind(); } } } else { //Check For Job ID if (Selection.Contains("n_objectid")) { //Get ID recordToDelete = Convert.ToInt32(Selection.Get("n_objectid")); } //Set Continue Bool continueDeletion = (recordToDelete > 0); //Check Continue Bool if (continueDeletion) { //Clear Errors _oMaintenanceObject.ClearErrors(); //Delete Jobstep if (_oMaintenanceObject.Delete(recordToDelete)) { //Set Deletion Done deletionDone = true; } } //Check Deletion Done if (deletionDone) { //Perform Refresh ObjectGrid.DataBind(); } } } }
protected void Page_Load(object sender, EventArgs e) { //Check For Logon Class if (HttpContext.Current.Session["LogonInfo"] != null) { //Get Logon Info From Session _oLogon = ((LogonObject)HttpContext.Current.Session["LogonInfo"]); //Add Use ID TO Session HttpContext.Current.Session.Add("UserID", _oLogon.UserID); //Load Form Permissions if (FormSetup(_oLogon.UserID)) { //Setup Buttons Master.ShowSaveButton = false; Master.ShowNewButton = _userCanAdd; Master.ShowEditButton = _userCanEdit; Master.ShowDeleteButton = _userCanDelete; Master.ShowViewButton = _userCanView; Master.ShowPrintButton = true; Master.ShowPdfButton = false; Master.ShowXlsButton = true; Master.ShowMultiSelectButton = _userCanDelete; } } //Check For Post Back if (!IsPostBack) { //Bind Grid ObjectGrid.DataBind(); } else { var scriptManager = ScriptManager.GetCurrent(Page); if (scriptManager != null && scriptManager.IsInAsyncPostBack) { } //Get Control That Caused Post Back var controlName = Request.Params.Get("__EVENTTARGET"); //Check For Null if (!string.IsNullOrEmpty(controlName)) { //Determing What To Do switch (controlName.Replace("ctl00$Footer$", "")) { case "NewButton": { //Call View Routine AddNewRow(); break; } case "EditButton": { //Call View Routine EditSelectedRow(); break; } case "DeleteButton": { //Call View Routine DeleteSelectedRow(); break; } case "ViewButton": { //Call View Routine ViewSelectedRow(); break; } case "PrintButton": { //Call Print Routine PrintSelectedRow(); break; } case "ExportPDF": { //Call Export PDF Option ExportPdf(); break; } case "ExportXLS": { //Call Export XLS Option ExportXls(); break; } case "MultiSelect": { //Enable/Disable MultiSelect EnableMultiSelect(!(ObjectGrid.Columns[0].Visible)); break; } default: { //Do Nothing break; } } } } //Enable/Disable Buttons Master.ShowNewButton = !(ObjectGrid.Columns[0].Visible); Master.ShowEditButton = !(ObjectGrid.Columns[0].Visible); Master.ShowViewButton = !(ObjectGrid.Columns[0].Visible); Master.ShowPrintButton = !(ObjectGrid.Columns[0].Visible); //Clear Prior Selection If Edit Check Is No Longer Visible if (!(ObjectGrid.Columns[0].Visible)) { //Uncheck All ObjectGrid.Selection.UnselectAll(); } }
public override void Place(Vector2Int coords, ObjectGrid objectGrid) { ForceMovementTrap newTrap = (ForceMovementTrap)objectGrid.CreateCellObject(coords, this); newTrap.DirectionIndex = this.directionIndex; }
void Start() { grid = GameObject.Find("_ObjectGrid").GetComponent <ObjectGrid>(); }
private void AddGrid() { //Setup LevelGrid ObjectGrid levelGrid = new ObjectGrid("levelGrid", this, 49, 29, 1920, 960); #region Grid string[,] grid = new string[49, 29]; grid[21, 12] = "1"; grid[21, 13] = "2"; grid[21, 14] = "3"; grid[21, 15] = "4"; grid[21, 16] = "5"; grid[21, 17] = "6"; grid[21, 18] = "7"; grid[21, 19] = "8"; grid[17, 6] = "9"; grid[14, 5] = "10"; grid[12, 6] = "11"; grid[13, 6] = "12"; grid[16, 7] = "13"; grid[16, 8] = "14"; grid[17, 8] = "15"; grid[18, 7] = "16"; grid[14, 8] = "17"; grid[15, 8] = "18"; grid[13, 8] = "19"; grid[13, 9] = "20"; grid[13, 10] = "21"; grid[14, 10] = "22"; grid[15, 10] = "23"; grid[16, 10] = "24"; grid[17, 10] = "25"; grid[16, 11] = "26"; grid[16, 12] = "27"; grid[17, 12] = "28"; grid[18, 12] = "29"; grid[18, 13] = "30"; grid[19, 13] = "31"; grid[20, 13] = "32"; grid[16, 19] = "33"; grid[17, 19] = "34"; grid[18, 19] = "35"; grid[19, 19] = "36"; grid[20, 19] = "37"; grid[15, 17] = "38"; grid[15, 18] = "39"; grid[15, 19] = "40"; grid[15, 20] = "41"; grid[15, 21] = "42"; grid[16, 17] = "43"; grid[17, 17] = "44"; grid[18, 16] = "45"; grid[18, 17] = "46"; grid[17, 16] = "47"; grid[19, 16] = "48"; grid[20, 16] = "49"; grid[15, 12] = "50"; grid[15, 13] = "51"; grid[15, 14] = "52"; grid[13, 14] = "53"; grid[14, 14] = "54"; grid[12, 14] = "55"; grid[12, 15] = "56"; grid[12, 16] = "57"; grid[10, 16] = "58"; grid[11, 16] = "59"; grid[7, 14] = "60"; grid[6, 14] = "61"; grid[6, 16] = "62"; grid[6, 17] = "63"; grid[6, 18] = "64"; grid[6, 19] = "65"; grid[5, 19] = "66"; grid[2, 17] = "67"; grid[1, 19] = "68"; grid[0, 19] = "69"; grid[0, 20] = "70"; grid[0, 21] = "71"; grid[0, 22] = "72"; grid[1, 22] = "73"; grid[2, 21] = "74"; grid[2, 22] = "75"; grid[3, 21] = "76"; grid[4, 21] = "77"; grid[5, 21] = "78"; grid[5, 22] = "79"; grid[6, 22] = "80"; grid[7, 21] = "81"; grid[7, 22] = "82"; grid[8, 21] = "83"; grid[9, 21] = "84"; grid[10, 20] = "85"; grid[13, 21] = "86"; grid[14, 21] = "87"; grid[15, 1] = "88"; grid[15, 3] = "89"; grid[15, 2] = "90"; grid[15, 1] = "91"; grid[15, 0] = "92"; grid[16, 1] = "93"; grid[16, 0] = "94"; #endregion for (int i = 1; i < 95; i++) { for (int x = 0; x < 49; x++) { for (int y = 0; y < 29; y++) { if (grid[x, y] != null && int.Parse(grid[x, y]) == i) { GridDungeon room = new GridDungeon("level1", levelGrid, i.ToString(), 96, new Vector2(x * 20 * 96, y * 10 * 96)); room.CanCollide = true; levelGrid.Grid[x, y] = room; } } } } //load the random dungeons on the correct position in levelGrid loadRandomDungeon(levelGrid, new RDRG1(new Vector2(14, 5))); loadRandomDungeon(levelGrid, new RDRG2(new Vector2(18, 7))); loadRandomDungeon(levelGrid, new RDRG3(new Vector2(7, 14))); loadRandomDungeon(levelGrid, new RDRG4(new Vector2(2, 17))); loadRandomDungeon(levelGrid, new RDRG5(new Vector2(10, 20))); levelGrid.CanCollide = true; //Add the levelGrid Add(levelGrid); }
public override bool CanPlace(Vector2Int coords, ObjectGrid objectGrid) { return(base.CanPlace(coords, objectGrid) && base.CanPlace(coords + GetPairOffset(), objectGrid)); }