public static bool EntranceExistsAt(int2 position, Data.Room room) { foreach (Data.Entrance entrance in room.Entrances) { if (entrance.Bounds.Contains(new Vector2Int(position.x, position.y))) { return(true); } } return(false); }
public bool deleteroom(Data.Room drm) { bool stat = false; koneksi kon = new koneksi(); try { kon.openConnection(); string query = "delete from tb_room where room_id='" + drm.Roomid + "'"; kon.ExecuteQueries(query); stat = true; kon.closeConnection(); } catch (Exception ex) { } return(stat); }
public bool editroom(Data.Room dro) { bool stat = false; koneksi kon = new koneksi(); try { kon.openConnection(); string query = "update tb_room set type_room='" + dro.Roomtype + "',price_room='" + dro.Roomprice + "' where room_id='" + dro.Roomid + "'"; kon.ExecuteQueries(query); stat = true; kon.closeConnection(); } catch (Exception ex) { } return(stat); }
public bool addroom(Data.Room dr) { bool stat = false; koneksi kon = new koneksi(); try { kon.openConnection(); string query = "insert into tb_room values('" + dr.Roomid + "', '" + dr.Roomtype + "', '" + dr.Roomprice + "')"; kon.ExecuteQueries(query); stat = true; kon.closeConnection(); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(stat); }
private void SetupRoom(Data.Room room) { for (int x = room.Bounds.xMin; x <= room.Bounds.xMax; x++) { for (int y = room.Bounds.yMin; y <= room.Bounds.yMax; y++) { int2 cellPosition = new int2(x, y); SetupGround(cellPosition, room.GroundType); if (Util.Map.EntranceExistsAt(x, y, room) == false) { if (room.Fill || Util.Map.OnRectBoundary(x, y, room.Bounds)) { SetupStructure(cellPosition, room.StructureType); } } SetupOverlay(cellPosition, room.OverlayType); } } }
public static bool EntranceExistsAt(int x, int y, Data.Room room) { return(EntranceExistsAt(new int2(x, y), room)); }
public void Sync(ISyncableData data) { _data = (Data.Room)data; }