private void newAddressButton_Click(object sender, EventArgs e) { NewRoom test = new NewRoom(); test.Owner = this; test.Show(); }
private void listBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { this.FurnitureContainer.Children.Clear(); if (listBox.SelectedItem == null) { return; } ListBoxItem lbi = ((sender as ListBox).SelectedItem as ListBoxItem); string Engineroomname = ""; Engineroomname = lbi.Content.ToString(); NewRoom room = new NewRoom(); foreach (NewRoom roomtemp in rooms) { if (roomtemp.roomname == Engineroomname) { room = roomtemp; } } foreach (ModelWall wall in room.walls) { this.FurnitureContainer.Children.Add(wall); } for (int i = 0; i < room.myStore.Count; i++) { ModelObject ex = (ModelObject)room.myStore.GetByIndex(i); string RFID = room.myStore.GetKey(i).ToString(); this.FurnitureContainer.Children.Add(ex); } this.canvas1.Visibility = Visibility.Visible; }
private void listBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { this.FurnitureContainer.Children.Clear(); if (listBox.SelectedItem == null) { return; } ListBoxItem lbi = ((sender as ListBox).SelectedItem as ListBoxItem); string Engineroomname = ""; Engineroomname = lbi.Content.ToString(); NewRoom room=new NewRoom(); foreach (NewRoom roomtemp in rooms) { if (roomtemp.roomname == Engineroomname) { room = roomtemp; } } foreach (ModelWall wall in room.walls) { this.FurnitureContainer.Children.Add(wall); } for (int i = 0; i < room.myStore.Count; i++) { ModelObject ex = (ModelObject)room.myStore.GetByIndex(i); string RFID = room.myStore.GetKey(i).ToString(); this.FurnitureContainer.Children.Add(ex); } this.canvas1.Visibility = Visibility.Visible; }
public string CreateChannelRoom(string id, [FromBody] NewRoom room) { room.OwnerId = _am.Authenticate(HttpContext).Id; room.ChannelId = id; _cm.CreateChannelRoom(room); return("Successfully created Room"); }
public void AddRangesFromRoom(NewRoom room) { foreach (var r in room.rangeCornerManager.ranges) { NewRoomGenerator.instancia.dimensionSectors.AddDimensionRange(r.dimensionSectorRange); } }
public ActionResult DeleteConfirmed(int id) { NewRoom newRoom = db.NewRooms.Find(id); db.NewRooms.Remove(newRoom); db.SaveChanges(); return(RedirectToAction("Index")); }
public void Build(NewRoom room) // build lvl 1 from build panel { GameObject gameObject = GameObject.Find(roomHandler.id.ToString()); RoomProperty currentRoom = gameObject.GetComponent <RoomProperty>(); Animator animator = gameObject.GetComponent <Animator>(); GameOver over = stat.GetComponent <GameOver>(); if (score.money >= room.BuildCost[0]) { // minus money and happiness score.MoneyOperation(-room.BuildCost[0]); score.HappinessOperation(room.Happiness[0]); animator.SetInteger("index", room.AnimationIndex[0]); // and pass param to corespond room // naming currentRoom.label = room.Label; currentRoom.description = room.Description[0]; currentRoom.resourceType = room.ResourceType; // base param currentRoom.baseResorceGenerate = room.Resource[0]; currentRoom.productConsume = room.ProductConsume[0]; currentRoom.baseTaxToPay = room.Taxes[0]; currentRoom.baseTimeGenerate = room.ProductionTime[0]; currentRoom.costBuild = room.BuildCost[0]; currentRoom.lvl = 1; currentRoom.roomIndex = room.RoomIndex; // rename later in RoomProperty // multi // currentRoom.localResoureceMulti = room.LocalMoneyMulti[0]; // currentRoom.localTaxMulti = room.TaxMulti[0]; // currentRoom.localTimeMulti = room.TimeMulti[0]; // currentRoom.eventMulti = room.EventMulti[0]; // do smth with local support ////// // bool managment currentRoom.isEmpty = false; // handle sprite update currentRoom.image = room.Image[0]; currentRoom.UpdateSprite(); // operations with global multi at Score score.globalResourceMulti *= room.MoneyMulti[0]; score.globalTaxMulti *= room.TaxMulti[0]; score.globalTimeMulti *= room.TimeMulti[0]; score.globalEventChance *= room.EventMulti[0]; timeLine.eventChance *= room.EventMulti[0]; // update data in room currentRoom.UpdateMulti(); currentRoom.NullTimer(); currentRoom.Select(); // and Handle UI panels upgradePanel.SetActive(true); buildPanel.SetActive(false); buildEvent.Raise(); int id = int.Parse(roomHandler.id); over.roomLabels[id] = room.Label; } }
public ActionResult Edit([Bind(Include = "Id,room,NameBuild,Floor")] NewRoom newRoom) { if (ModelState.IsValid) { db.Entry(newRoom).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(newRoom)); }
public ActionResult Create([Bind(Include = "Id,room,NameBuild,Floor")] NewRoom newRoom) { if (ModelState.IsValid) { db.NewRooms.Add(newRoom); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(newRoom)); }
public void setmessge(string s1, string s2, string s3) { RFID = s1; rfid = s2; servertype = s3; aservertype = Convert.ToInt32(s3); this.FurnitureContainer3.Children.Clear(); Getxmal xmal = new Getxmal("2.xml"); xmal.scenelayout(ref roomgate); NewRoom room = roomgate[0]; for (int i = 0; i < room.myStore.Count; i++) { ModelObject ex = (ModelObject)room.myStore.GetByIndex(i); string RFID1 = room.myStore.GetKey(i).ToString(); string parentrfid = ex.parentrfid; if ((RFID1 == RFID) || (parentrfid == RFID)) { if (ex.type == 2) { servercabinet = ex; } ex.Move(-1.5, ex.translate.OffsetY - 5, 0, 0); this.FurnitureContainer3.Children.Add(ex); } } server.RFID = rfid; server.server(1.5, 0.2 * aservertype, 0.95); int cout = 0; for (int j = 0; j <= servercabinet.usize.Length; j++)// 从头循环 { if (servercabinet.usize[j] == "0") { cout++; } else { cout = 0; } if (aservertype <= (cout - 2)) { server.Move(-1.5, -5 + 0.2 + 0.2 + 0.2, 0, 0); aposition = Convert.ToInt32((server.translate.OffsetY + 5 - 0.2) / 0.2); break; } } this.FurnitureContainer3.Children.Add(server); }
private void button3_Click(object sender, RoutedEventArgs e) { this.FurnitureContainer2.Children.Clear(); roomgate.Clear(); Getxmal xmal = new Getxmal("2.xml"); xmal.scenelayout(ref roomgate); NewRoom room = roomgate[0]; foreach (ModelWall wall in room.walls) { this.FurnitureContainer2.Children.Add(wall); } for (int i = 0; i < room.myStore.Count; i++) { ModelObject ex = (ModelObject)room.myStore.GetByIndex(i); room.myStore.GetKey(i).ToString(); this.FurnitureContainer2.Children.Add(ex); } for (int i = 0; i < room.myStore.Count; i++) { ModelObject ex = (ModelObject)room.myStore.GetByIndex(i); int type = 0; type = ex.type; if (type == 2) { int servercout = Convert.ToInt32(comboBox1.Text); int cout = 0; for (int j = 0; j < ex.usize.Length; j++)// 从头循环 { if (ex.usize[j] == "0") { cout++; } else { cout = 0; } if ((servercout + 2) <= cout) { //ex.selected = 1; //ex.cabinetmaterial.Brush = Brushes.Red; //ex.cabinetbackmaterial.Brush = Brushes.Red; break; } } } } }
// GET: NewRooms/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } NewRoom newRoom = db.NewRooms.Find(id); if (newRoom == null) { return(HttpNotFound()); } return(View(newRoom)); }
public bool ComprobarLugarDeSpawn(CellDoor cellDoor, NewRoom room, ref int index) { //obtengo la direccion hacia donde tengo que ir //obtengo todas las puertas del vecino //agarro una al azar var dirtospawn = cellDoor.doorDir.V3ToSpawn(); var puertasdelvecino = room.doormanager.GetDoorsByType(cellDoor.doorDir.Counter()); if (puertasdelvecino.Count <= 0) { return(false); } var currentdoor = puertasdelvecino[UnityEngine.Random.Range(0, puertasdelvecino.Count)]; index = currentdoor.index; //calculo la posicion donde la proxima room tiene que spawnear //lo posiciono //actualizo los valores var spawnPosition = new Vector3( cellDoor.transform.position.x + dirtospawn.x + currentdoor.x_localdistance_tocore, 0, cellDoor.transform.position.z + dirtospawn.z + currentdoor.z_localdistance_tocore); room.transform.position = spawnPosition; room.transform.SetParent(NewRoomGenerator.instancia.gameObject.transform); room.RefreshValues(); //me fijo si una vez posicionado realmente puedo posicionarlo ahi // foreach (var d in room.rangeCornerManager.ranges) { if (!NewRoomGenerator.instancia.dimensionSectors.CanAddDimensionRange(d.dimensionSectorRange)) { Destroy(room.gameObject); return(false); } else { continue; } } //esto lo agrego a la lista de dimensiones, tiene que ir afuera //porque me tengo que asegurar de que todas sean validas primero return(true); }
public async Task <ActionResult <bool> > Create([FromBody] NewRoom newRoom) { var tenant = (await _tenantService.GetTenantFromHostAsync()); if (tenant != null) { Console.WriteLine($"creating room for {tenant.Id} : {tenant.Name}"); using (var context = _tenantService.CreateContext(tenant)) { var roomService = new RoomService(context); return(Ok(await roomService.CreateRoomAsync(newRoom))); } } return(BadRequest("Tenant doesn't exist")); }
public override string DoAction() { DungeonPosition pos = ((PlayerCharacter)(Character)).Room.Position; int x = pos.X; int y = pos.Y; DungeonRoom room = Character.Dungeon.GetRoom(pos.X, pos.Y); DungeonRoom NewRoom; //room.RemoveCharacter(Character); switch (direction) { case MapDirection.north: y -= 1; break; case MapDirection.south: y += 1; break; case MapDirection.east: x += 1; break; case MapDirection.west: x -= 1; break; } foreach (MudCharacter c in Character.Room.GetCharactersInRoom()) { if (!(c is PlayerCharacter)) { return("Some sort of magic barrier prevents you from leaving a room with live evil minions"); } } NewRoom = Character.Dungeon.GetRoom(x, y); if (NewRoom == null) { return(String.Format("{0} ran into the wall", Character.Name)); } room.NotifyPlayers(Character.Name + " has left the room heading " + MoveAction.DirectionString[(int)direction]); room.RemoveCharacter(Character); NewRoom.AddCharacter(Character); return(""); }
public async Task <bool> CreateRoomAsync(NewRoom newRoom) { var project = await _tenantDataContext.Projects.FirstOrDefaultAsync(x => x.Id == newRoom.ProjectId); if (project == null) { Console.WriteLine("Couldn't find project"); return(false); } newRoom.Room.Project = project; await _tenantDataContext.Rooms.AddAsync(newRoom.Room); newRoom.Room.Chats = new List <Chat>(); newRoom.Room.Memberships = new List <RoomMembership>(); foreach (var roomMembership in newRoom.Memberships) { newRoom.Room.Memberships.Add(new RoomMembership() { RoomId = newRoom.Room.Id, UserId = roomMembership.Id }); } if (project.Rooms == null) { project.Rooms = new List <Room>(); } project.Rooms.Add(newRoom.Room); try { await _tenantDataContext.SaveChangesAsync(); return(true); } catch (Exception e) { Console.WriteLine($"Exception when creating room {e}"); return(false); } }
public void FirstRoom() { foreach (var s in samples) { if (s.one_per_dungeon) { s.weight = int.MaxValue; } } var room = NewRoom.SpawnAndGet(firstRoom); room.transform.SetParent(this.transform); room.transform.position = new Vector3(5, 0, 5); roomBase = room; currentCantRooms++; AddRangesFromRoom(room); listrooms.Add(room); room.CreateNewRoom(null); OnEnd(listrooms); }
public NewRoom AddRecord(NewRoom newRoom) { using (SqlConnection connection = new SqlConnection(this._connectionString)) { connection.Open(); using (SqlCommand command = new SqlCommand(queryInsert, connection)) { command.Parameters.AddWithValue("Fio", newRoom.Fio); command.Parameters.AddWithValue("NumberPhone", newRoom.NumberPhone); command.Parameters.AddWithValue("Email", newRoom.Email); command.Parameters.AddWithValue("DescriptionRommId", newRoom.DescriptionRommId); command.Parameters.AddWithValue("DateFrom", Convert.ToDateTime(newRoom.DateFrom)); command.Parameters.AddWithValue("DateTo", Convert.ToDateTime(newRoom.DateTo)); command.Parameters.AddWithValue("Reserve", newRoom.Reserve); int connectId = (int)command.ExecuteScalar(); newRoom.Id = connectId; return(newRoom); } } }
bool ForcedRoom(CellDoor door) { var room = new NewRoom(); Debug.Log("tengo " + NewRoomGenerator.instancia.forcerooms.Count + " forced rooms"); Debug.Log("El current es: " + NewRoomGenerator.instancia.currentCantRooms); GameObject trygo = NewRoomGenerator.instancia.forcerooms[NewRoomGenerator.instancia.currentCantRooms - 1]; if (NewRoomGenerator.instancia.currentCantRooms == NewRoomGenerator.instancia.MaxRooms) { room = SpawnAndGet(NewRoomGenerator.instancia.lastRoom); } else { room = SpawnAndGet(trygo); } int index = 0; if (ComprobarLugarDeSpawn(door, room, ref index)) { vecinos.Add(room); NewRoomGenerator.instancia.AddRangesFromRoom(room); SetOcuppiedDoor(door.index); room.doormanager.doors[index].Occuppied = true; room.gameObject.name = "Room_" + NewRoomGenerator.instancia.currentCantRooms.ToString("00"); NewRoomGenerator.instancia.currentCantRooms++; NewRoomGenerator.instancia.listrooms.Add(room); room.CreateNewRoom(this); return(true); } else { Destroy(room.gameObject); return(false); } }
public void BrokedRoom(NewRoom newRoom) { using (var connection = new SqlConnection(this._connectionString)) { connection.Open(); using (var command = new SqlCommand()) { command.Connection = connection; command.CommandText = "procBrokedRoom"; command.CommandType = System.Data.CommandType.StoredProcedure; command.Parameters.AddWithValue("@Fio", newRoom.Fio); command.Parameters.AddWithValue("@NumberPhone", newRoom.NumberPhone); command.Parameters.AddWithValue("@Email", newRoom.Email); command.Parameters.AddWithValue("@DescriptionRoomId", newRoom.DescriptionRommId); command.Parameters.AddWithValue("@DateFrom", Convert.ToDateTime(newRoom.DateFrom)); command.Parameters.AddWithValue("@DateTo", Convert.ToDateTime(newRoom.DateTo)); command.Parameters.AddWithValue("@Reserve", newRoom.Reserve); command.ExecuteNonQuery(); } } }
public void BrokedRoom(BrokedRoomDTO room) { try { string connectionString = ConfigurationManager.ConnectionStrings["ConnectToSQL"].ConnectionString; IRoomRepository repository = new RoomRepository(connectionString); NewRoom newRoom = new NewRoom(); newRoom.Fio = room.Fio; newRoom.NumberPhone = room.NumberPhone; newRoom.Email = room.Email; newRoom.DescriptionRommId = room.DescriptionRommId; newRoom.DateFrom = room.DateFrom; newRoom.DateTo = room.DateTo; newRoom.Reserve = room.Reserve; repository.BrokedRoom(newRoom); } catch (Exception e) { Exception baseException = e.GetBaseException(); throw new FaultException(e.Message); } }
public void CreateNewRoom(NewRoom parent) { RefreshValues(); //Mis puertas var stackOfDoors = new Stack <CellDoor>(doormanager.doors.Where(x => !x.Occuppied).ToList().Shuffle()); // RECORRO PUERTAS while (stackOfDoors.Count > 0) { //reservo var popped_door = stackOfDoors.Pop(); // ME FIJO SI HAY LUGAR if (!isABranchRoom) { if ((NewRoomGenerator.instancia.AvaliablePlaces())) { if (NewRoomGenerator.instancia.canBranch) { if (NewRoomGenerator.instancia.currentCantRooms == 10 || NewRoomGenerator.instancia.currentCantRooms == 15 || NewRoomGenerator.instancia.currentCantRooms == 20) { marktocontinue = true; } } Explode(popped_door); } } if (marktocontinue) { if (stackOfDoors.Count <= 0) { if (parent) { parent.marktocontinue = true; } marktocontinue = false; return; } else { popped_door = stackOfDoors.Pop(); if (!ExplodeBranch(popped_door)) { if (stackOfDoors.Count == 0) { if (parent) { parent.marktocontinue = true; } marktocontinue = false; return; } continue; } } } if (isABranchRoom) { if (stackOfDoors.Count > 0) { popped_door = stackOfDoors.Pop(); if (NewRoomGenerator.instancia.AvaliablePlacesBranch()) { if (!ExplodeBranch(popped_door)) { continue; } } } NewRoomGenerator.instancia.currentCantRoomsBranch = 0; return; } #region unused //if (NewRoomGenerator.instancia.currentCantRooms == 10 || NewRoomGenerator.instancia.currentCantRooms == 20) //{ // if (stackOfDoors.Count > 0) // { // isNode = true; // var popped_door_branch = stackOfDoors.Pop(); // if (Explode(popped_door_branch, true)) // { // this.gameObject.name = "(NODE)Room_" + NewRoomGenerator.instancia.currentCantRoomsBranch.ToString("00"); // isNode = false; // } // else // { // isNode = false; // parent.isNode = true; // } // } // else // { // isNode = false; // parent.isNode = true; // } //} #endregion } }
public void SetCurrentRoom(NewRoom room) => currentroom = room;
/// <summary> /// Creates a new chat room on the server. /// </summary> /// <param name="newRoom">The new room to create.</param> public void CreateRoom(NewRoom newRoom) { CreateRoomPacket packet = new CreateRoomPacket(newRoom.Name, newRoom.Description, newRoom.RoomPassword, newRoom.AdminPassword); SendPacket(PacketHelper.Serialize(packet)); }
private void button5_Click(object sender, RoutedEventArgs e) { string rfid = textBox1.Text; NewRoom room = rooms[0]; for (int i = 0; i < room.myStore.Count; i++) { ModelObject ex = (ModelObject)room.myStore.GetByIndex(i); string RFID = room.myStore.GetKey(i).ToString(); if (RFID == rfid) { switch (ex.type) { case 1: { MessageBox.Show("查询设备是服务器"); break; } case 2: { ex.materiala[4].Brush = Brushes.Red; ex.materiala[5].Brush = Brushes.Red; ex.materiala[6].Brush = Brushes.Red; ex.materiala[7].Brush = Brushes.Red; ex.materiala[8].Brush = Brushes.Red; ex.materiala[9].Brush = Brushes.Red; ex.materiala[10].Brush = Brushes.Red; ex.materiala[11].Brush = Brushes.Red; ex.materialb[1].Brush = Brushes.Red; ex.materialb[2].Brush = Brushes.Red; ex.materialb[3].Brush = Brushes.Red; ex.materialb[4].Brush = Brushes.Red; ex.materialb[5].Brush = Brushes.Red; ex.materialb[6].Brush = Brushes.Red; ex.materialb[7].Brush = Brushes.Red; ex.materialb[8].Brush = Brushes.Red; ex.materialb[9].Brush = Brushes.Red; ex.materialb[10].Brush = Brushes.Red; ex.materialb[11].Brush = Brushes.Red; ex.materialc[1].Brush = Brushes.Red; ex.materialc[2].Brush = Brushes.Red; ex.materialc[3].Brush = Brushes.Red; ex.materialc[4].Brush = Brushes.Red; ex.materialc[5].Brush = Brushes.Red; ex.materialc[8].Brush = Brushes.Red; ex.materialc[9].Brush = Brushes.Red; ex.materialc[10].Brush = Brushes.Red; ex.materialc[11].Brush = Brushes.Red; ex.materiald[1].Brush = Brushes.Red; ex.materiald[2].Brush = Brushes.Red; ex.materiald[3].Brush = Brushes.Red; ex.materiald[6].Brush = Brushes.Red; ex.materiald[7].Brush = Brushes.Red; ex.materiald[8].Brush = Brushes.Red; ex.materiald[9].Brush = Brushes.Red; ex.materiald[10].Brush = Brushes.Red; ex.materiald[11].Brush = Brushes.Red; ex.materialf[1].Brush = Brushes.Red; ex.materialf[2].Brush = Brushes.Red; ex.materialf[3].Brush = Brushes.Red; ex.materialf[4].Brush = Brushes.Red; ex.materialf[5].Brush = Brushes.Red; ex.materialf[6].Brush = Brushes.Red; ex.materialf[7].Brush = Brushes.Red; ex.materialf[10].Brush = Brushes.Red; ex.materialf[11].Brush = Brushes.Red; MessageBox.Show("查询设备是机柜"); break; } case 3: { MessageBox.Show("查询设备是UPS设备"); break; } case 4: { MessageBox.Show("查询设备是空调"); break; } } } } }
bool RandomRoom(CellDoor door) { foreach (var s in NewRoomGenerator.instancia.samples) { if (NewRoomGenerator.instancia.currentCantRooms == s.IndexToAppear) { s.weight = 0; } } var stackrooms = NewRoomGenerator.instancia.GetStackOffRooms(); // RECORRO LAS ROOMS while (stackrooms.Count > 0) { var room = new NewRoom(); bool last = false; var sample = stackrooms.Pop(); if (NewRoomGenerator.instancia.currentCantRooms == NewRoomGenerator.instancia.MaxRooms - 1) { room = SpawnAndGet(NewRoomGenerator.instancia.lastRoom); last = true; } else { room = SpawnAndGet(sample.model); } int index = 0; if (ComprobarLugarDeSpawn(door, room, ref index)) { vecinos.Add(room); NewRoomGenerator.instancia.AddRangesFromRoom(room); SetOcuppiedDoor(door.index); room.doormanager.doors[index].Occuppied = true; room.gameObject.name = "Room_" + NewRoomGenerator.instancia.currentCantRooms.ToString("00"); NewRoomGenerator.instancia.currentCantRooms++; NewRoomGenerator.instancia.listrooms.Add(room); if (!last) { NewRoomGenerator.instancia.samples[sample.originalIndex].weight++; if (sample.one_per_dungeon) { sample.weight = int.MaxValue; } } room.CreateNewRoom(this); return(true); } else { Destroy(room.gameObject); continue; } } return(false); }
private void AddRoomBt_Click(object sender, EventArgs e) { var form = new NewRoom(); form.ShowDialog(this); }