示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
        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);
                }
            }
        }
示例#6
0
 public static bool EntranceExistsAt(int x, int y, Data.Room room)
 {
     return(EntranceExistsAt(new int2(x, y), room));
 }
示例#7
0
 public void Sync(ISyncableData data)
 {
     _data = (Data.Room)data;
 }