예제 #1
0
        public async Task <IActionResult> PutHouseObject(int id, HouseObject houseObject)
        {
            if (id != houseObject.HouseObjectId)
            {
                return(BadRequest());
            }

            _context.Entry(houseObject).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!HouseObjectExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
예제 #2
0
        public async Task <ActionResult <HouseObject> > PostHouseObject(HouseObject houseObject)
        {
            _context.HouseObjects.Add(houseObject);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetHouseObject", new { id = houseObject.HouseObjectId }, houseObject));
        }
예제 #3
0
    private void renderSelectionInfo(Graphics g)
    {
        StringBuffer strBuffer = new StringBuffer();

        strBuffer.append("selection: ");
        if (this.m_selectedObject == null)
        {
            strBuffer.append("none");
        }
        else if (house.Room.house_cast(this.m_selectedObject) != null)
        {
            house.Room room = house.Room.house_cast(this.m_selectedObject);
            strBuffer.append("room (floor=").append(GlobalConstants.LOOKUP_FLOOR[room.getFloor()]).append(", wall=").append(GlobalConstants.LOOKUP_WALL[room.getWall()]).append(")");
        }
        else if (Door.house_cast(this.m_selectedObject) != null)
        {
            Door door = Door.house_cast(this.m_selectedObject);
            strBuffer.append("door (type=").append(GlobalConstants.LOOKUP_OBJECT[door.getType()]).append(")");
        }
        else if (HouseObject.house_cast(this.m_selectedObject) != null)
        {
            HouseObject houseObject = HouseObject.house_cast(this.m_selectedObject);
            strBuffer.append("object (type=").append(GlobalConstants.LOOKUP_OBJECT[houseObject.getType()]).append(")");
        }
        else if (Window.house_cast(this.m_selectedObject) != null)
        {
            Window window = Window.house_cast(this.m_selectedObject);
            strBuffer.append("window (type=").append(GlobalConstants.LOOKUP_OBJECT[window.getType()]).append(")");
        }
        this.m_engine.getTextManager().drawString(g, strBuffer, 5, 5, 5, 9);
    }
예제 #4
0
        public void SetItem(HouseObject item, HousePopupController controller)
        {
            houseObject = item;

            this.controller = controller;

            RefreshItem();
        }
예제 #5
0
    public void Load()
    {
        houseObject = GameManager.instance.gamedatabaseManager.GetObject <HouseObject>(houseObjectId);

        if (animal != null)
        {
            animal.Load();
        }
    }
예제 #6
0
        public void SetHouseObject(HouseObject houseObject)
        {
            if (house == null)
            {
                house = new House();
            }

            house.SetHouseObject(houseObject);
            houseIcon.sprite = house.houseObject.image;
        }
예제 #7
0
    private void UpdateLastItemSelected(HouseObject newObject)
    {
        if (lastItemSelected)
        {
            lastItemSelected.ChangeItemState(false);
        }

        lastItemSelected = newObject;
        lastItemSelected.ChangeItemState(true);
        SelectedHouseObjectUpdated(lastItemSelected);
    }
        public void SetHouse(HouseObject houseObject)
        {
            if (currentSelectedSlot)
            {
                currentSelectedSlot.SetHouseObject(houseObject);

                TowerManager.instance.houseSlotManager.ToggleShowHouse(false);
                TowerManager.instance.sideUIController.HideCancelButton();
            }

            Close();
        }
예제 #9
0
 private void setSelectedObjectAttributes()
 {
     if (house.Room.house_cast(this.m_selectedObject) != null)
     {
         house.Room room = house.Room.house_cast(this.m_selectedObject);
         JSystem.println("setting room attributes");
         room.setFloor(this.m_currSelectionFirstList);
         room.setWall(this.m_currSelectionSecondList);
     }
     else if (Door.house_cast(this.m_selectedObject) != null)
     {
         Door.house_cast(this.m_selectedObject).setType(this.getAttributeValueLookupIndex(this.m_currSelectionFirstList, 0));
     }
     else if (HouseObject.house_cast(this.m_selectedObject) != null)
     {
         HouseObject houseObject = HouseObject.house_cast(this.m_selectedObject);
         if (this.m_currentFacingSelectionButtonId == 4)
         {
             houseObject.setFacing(0);
         }
         else if (this.m_currentFacingSelectionButtonId == 5)
         {
             houseObject.setFacing(2);
         }
         else if (this.m_currentFacingSelectionButtonId == 6)
         {
             houseObject.setFacing(1);
         }
         else if (this.m_currentFacingSelectionButtonId == 7)
         {
             houseObject.setFacing(3);
         }
         int valueLookupIndex = this.getAttributeValueLookupIndex(this.m_currSelectionFirstList, 0);
         this.m_prevAddedObjectType = valueLookupIndex;
         houseObject.setType(valueLookupIndex);
     }
     else
     {
         if (Window.house_cast(this.m_selectedObject) == null)
         {
             return;
         }
         Window.house_cast(this.m_selectedObject).setType(this.getAttributeValueLookupIndex(this.m_currSelectionFirstList, 0));
     }
 }
예제 #10
0
        public Task <OperationResult> CreateHouseObjects(HouseObjectCreateViewModel obj)
        {
            var housingLayoutId = Guid.NewGuid();

            var houseObj = new HouseObject
            {
                HouseObjectId         = Guid.NewGuid(),
                HousingLayoutId       = housingLayoutId,
                DealDate              = obj.DealDate,
                Address               = obj.Address,
                HouseAge              = obj.HouseAge,
                County                = obj.County,
                IsParkingSpace        = obj.IsParkingSpace,
                ParkingSpacePrice     = obj.ParkingSpacePrice,
                ParkingSpaceSqureFeet = obj.ParkingSpaceSqureFeet,
                Region                = obj.Region,
                Remark                = obj.Remark,
                Source                = obj.Source,
                SquareFeet            = obj.SquareFeet,
                SquareFeetUnitPrice   = obj.SquareFeetUnitPrice,
                TotalFloor            = obj.TotalFloor,
                TotalPrice            = obj.TotalPrice,
                Type       = obj.Type,
                ImgUrl     = obj.ImgUrl,
                Floor      = obj.Floor,
                CreateTime = DateTime.UtcNow.AddHours(8),
                EditeTime  = DateTime.UtcNow.AddHours(8),
                CreateUser = "******",
                EditeUser  = "******",
            };
            var housingLayout = new HousingLayout
            {
                HousingLayoutId = housingLayoutId,
                Bathroom        = obj.Bathroom,
                LivingRoom      = obj.LivingRoom,
                Room            = obj.Room,
                EditeTime       = DateTime.UtcNow.AddHours(8),
                CreateTime      = DateTime.UtcNow.AddHours(8),
                CreateUser      = "******",
                EditeUser       = "******"
            };
            var result = _repo.Insert(houseObj, housingLayout);

            return(result);
        }
예제 #11
0
    private int getAttributeValueLookupIndex(int uiListItemIndex, int listIndex)
    {
        int num = -1;

        if (house.Room.house_cast(this.m_selectedObject) != null)
        {
            num = uiListItemIndex;
        }
        else if (Door.house_cast(this.m_selectedObject) != null)
        {
            num = this.m_simWorld.getDoorTypeNthObject(uiListItemIndex);
        }
        else if (HouseObject.house_cast(this.m_selectedObject) != null)
        {
            num = this.m_simWorld.getBuildableNthObject(uiListItemIndex);
        }
        else if (Window.house_cast(this.m_selectedObject) != null)
        {
            num = this.m_simWorld.getWindowTypeNthObject(uiListItemIndex);
        }
        return(num);
    }
예제 #12
0
    private void renderCurrentHouse(Graphics g)
    {
        if (this.m_currentHouse == null)
        {
            return;
        }
        Vector rooms        = this.m_currentHouse.getRooms();
        int    num1         = rooms.size();
        Vector windows      = this.m_currentHouse.getWindows();
        int    num2         = windows.size();
        Vector houseObjects = this.m_currentHouse.getHouseObjects();
        int    num3         = houseObjects.size();
        Vector doors        = this.m_currentHouse.getDoors();
        int    num4         = doors.size();

        for (int index = 0; index < num1; ++index)
        {
            house.Room room = (house.Room)rooms.elementAt(index);
            this.renderPlaceableObject(g, 16711680, room.getX(), room.getY(), room.getWidth(), room.getHeight(), true, room == this.m_selectedObject, -1);
        }
        for (int index = 0; index < num2; ++index)
        {
            Window window = (Window)windows.elementAt(index);
            this.renderPlaceableObject(g, 16776960, window.getX(), window.getY(), window.getWidth(), window.getHeight(), false, window == this.m_selectedObject, -1);
        }
        for (int index = 0; index < num3; ++index)
        {
            HouseObject houseObject = (HouseObject)houseObjects.elementAt(index);
            this.renderPlaceableObject(g, 16711935, houseObject.getX(), houseObject.getY(), houseObject.getWidth(), houseObject.getHeight(), false, houseObject == this.m_selectedObject, houseObject.getFacing());
        }
        for (int index = 0; index < num4; ++index)
        {
            Door door = (Door)doors.elementAt(index);
            this.renderPlaceableObject(g, 65280, door.getX(), door.getY(), door.getWidth(), door.getHeight(), false, door == this.m_selectedObject, -1);
        }
    }
예제 #13
0
    void Update()
    {
        if (Input.GetMouseButtonDown(0) && !hasFailed)
        {
            ray = cameraIso.ScreenPointToRay(Input.mousePosition);

            RaycastHit hit;

            Physics.Raycast(ray, out hit, 1000f, carpetMask);


            if (hit.collider != null)
            {
                carpet.hasTouchedCarpet = true;
                carpet.canMoveFurniture = false;
                touchedObject           = hit.collider.GetComponent <HouseObject>();
            }



            Physics.Raycast(ray, out hit, 1000f, selectionFX);

            if (hit.collider != null)
            {
                carpet.hasTouchedSelectionFX       = true;
                carpet.hasTouchedHiddenSelectionFX = false;
                touchedSelectionFx = hit.collider.gameObject;
            }

            Physics.Raycast(ray, out hit, 1000f, furniture);

            if (hit.collider != null && carpet.canMoveFurniture == true)
            {
                touchedFurniture = hit.collider.transform.parent.GetComponent <Furniture>();

                touchedFurniture.isBeingDragged = true;
            }

            Physics.Raycast(ray, out hit, 1000f, defaultLayer);

            if (hit.collider != null)
            {
                Physics.Raycast(ray, out hit, 1000f, carpetMask);

                if (hit.collider == null)
                {
                    carpet.hasUnselectCarpet = true;
                }
            }

            ray = camera2D.ScreenPointToRay(Input.mousePosition);

            Physics.Raycast(ray, out hit, 1000f, hiddenCarpetMask);


            if (hit.collider != null)
            {
                carpet.isHiddenCarpetTouched = true;
                hiddenTouchedObject          = hit.collider.GetComponent <HiddenSpaceObjects>();
            }

            Physics.Raycast(ray, out hit, 1000f, selectionFX);


            if (hit.collider != null)
            {
                carpet.hasTouchedSelectionFX       = true;
                carpet.hasTouchedHiddenSelectionFX = true;
                touchedSelectionFx = hit.collider.gameObject;
            }

            Physics.Raycast(ray, out hit, 1000f, defaultLayer);

            if (hit.collider != null)
            {
                Physics.Raycast(ray, out hit, 1000f, hiddenCarpetMask);

                if (hit.collider == null)
                {
                    carpet.hasUnselectCarpet = true;
                }
            }
        }
        if (Input.GetKeyDown(KeyCode.E))
        {
            SceneManager.LoadScene(0);
        }
    }
예제 #14
0
 public static void AddHouse(HouseObject obj)
 {
     _objects[(int)LAYER_ORDER.HOUSES].Add(obj);
 }
예제 #15
0
 public void registerObject(HouseObject go)
 {
     householdObjects.Add(go);
 }
예제 #16
0
        public PlacesEditorF()
        {
            InitializeComponent();
            Icon        = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
            MaximumSize = MinimumSize = Size;
            Text        = "Places Editor";

            textX.KeyPress += (sender, e) =>
            {
                if (!char.IsNumber(e.KeyChar) && (Keys)e.KeyChar != Keys.Back)
                {
                    e.Handled = true;
                }
            };
            textY.KeyPress += (sender, e) =>
            {
                if (!char.IsNumber(e.KeyChar) && (Keys)e.KeyChar != Keys.Back)
                {
                    e.Handled = true;
                }
            };

            ComboBoxCategory.SelectedIndexChanged += (sender, e) =>
            {
                customFlatButtonAdd.Enabled = ComboBoxCategory.SelectedText != FilesManager.BuildSets[ComboBoxCategory.SelectedIndex].Name;
                PictureBox1.Image           = FilesManager.BuildSets[ComboBoxCategory.SelectedIndex].Image;
            };
            FilesManager.BuildSets.ForEach(s => ComboBoxCategory.Items.Add(s.Name));

            Global.Maps.ForEach(s => ComboBoxFacet.Items.Add(s.Name));
            if (Global.Maps.Length > 2 && Global.Maps[0]?.Name.ToLower() == "felucca" && Global.Maps[1]?.Name.ToLower() == "trammel")
            {
                ComboBoxFacet.Items.Add("Fel/Tram");
            }

            customFlatButtonCancel.Click += (sender, e) =>
            {
                if (customFlatButtonAdd.Tag is BuildingEntry build)
                {
                    build.Parent.Entries.Remove(build);
                    BuildingObject buildingObj = RenderObjectsManager.Get <BuildingObject>().FirstOrDefault(s => s.Entry == build);
                    if (buildingObj != null)
                    {
                        buildingObj.Dispose();
                    }

                    Close();
                }
                else if (customFlatButtonAdd.Tag is HouseEntry house)
                {
                    HouseObject houseObj = RenderObjectsManager.Get <HouseObject>().FirstOrDefault(s => s.Entry == house);
                    if (houseObj != null)
                    {
                        houseObj.Dispose();
                    }

                    FilesManager.Houses.Remove(house);
                    Close();
                }
                else if (customFlatButtonAdd.Tag is null)
                {
                }
            };

            customFlatButtonAdd.Click += (sender, e) =>
            {
                if (customFlatButtonAdd.Tag is BuildingEntry build)
                {
                    build.Description = textDescription.Text;
                    build.Location.X  = textX.Text.ToShort();
                    build.Location.Y  = textY.Text.ToShort();

                    int facet = ComboBoxFacet.SelectedIndex;
                    if (Global.Maps.Length > 2 && Global.Maps[0]?.Name.ToLower() == "felucca" && Global.Maps[1]?.Name.ToLower() == "trammel")
                    {
                        if (facet == 6)
                        {
                            facet = 7;
                        }
                    }

                    build.Map = facet;
                    build.Parent.Entries.Remove(build);
                    build.Parent = FilesManager.BuildSets[ComboBoxCategory.SelectedIndex];
                    FilesManager.BuildSets[ComboBoxCategory.SelectedIndex].Entries.Add(build);
                    build.IsEnabled = true;

                    RenderObjectsManager.AddBuilding(new BuildingObject(build));
                    Close();
                }
                else if (customFlatButtonAdd.Tag is HouseEntry house)
                {
                }
                else if (customFlatButtonAdd.Tag is null)
                {
                    int facet = ComboBoxFacet.SelectedIndex;
                    if (Global.Maps.Length > 2 && Global.Maps[0]?.Name.ToLower() == "felucca" && Global.Maps[1]?.Name.ToLower() == "trammel")
                    {
                        if (facet == 6)
                        {
                            facet = 7;
                        }
                    }

                    BuildingEntry entry = new BuildingEntry(FilesManager.BuildSets[ComboBoxCategory.SelectedIndex], textDescription.Text, new Position(textX.Text.ToShort(), textY.Text.ToShort()), facet);
                    FilesManager.BuildSets[ComboBoxCategory.SelectedIndex].Entries.Add(entry);
                    entry.IsEnabled = true;
                    RenderObjectsManager.AddBuilding(new BuildingObject(entry));

                    Close();
                }
            };

            textX.Text = MouseManager.Location.X.ToString();
            textY.Text = MouseManager.Location.Y.ToString();
            ComboBoxFacet.SelectedIndex = Global.Facet;
        }
예제 #17
0
    private void processInputMainEdit(int _event, int[] args)
    {
        switch (_event)
        {
        case 0:
            this.coordScreenToTile(args[1], args[2], ref this.m_activeTileX, ref this.m_activeTileY);
            break;

        case 3:
            JSystem.println("  single tap");
            int screenX1 = args[1];
            int screenY1 = args[2];
            this.coordScreenToTile(screenX1, screenY1, ref this.m_activeTileX, ref this.m_activeTileY);
            int mainEditButtonId1 = this.getMainEditButtonId(screenX1, screenY1);
            if (mainEditButtonId1 == 5)
            {
                this.writeCurrentHouseToFile();
                this.editStateTransition(5);
            }
            if (mainEditButtonId1 == 6)
            {
                this.writeCurrentHouseToFile();
                this.m_simWorld.editHouse(this.m_currentHouse.getId(), this.m_currentHouse);
                this.loadMap(this.m_currentHouse.getId());
                this.editStateTransition(5);
                break;
            }
            if (mainEditButtonId1 == 4 && this.m_selectedObject != null)
            {
                JSystem.println("object dropped on the trash button...");
                if (house.Room.house_cast(this.m_selectedObject) != null)
                {
                    this.m_currentHouse.deleteRoom((house.Room) this.m_selectedObject);
                }
                else if (Window.house_cast(this.m_selectedObject) != null)
                {
                    this.m_currentHouse.deleteWindow((Window)this.m_selectedObject);
                }
                else if (HouseObject.house_cast(this.m_selectedObject) != null)
                {
                    this.m_currentHouse.deleteHouseObject((HouseObject)this.m_selectedObject);
                }
                else if (Door.house_cast(this.m_selectedObject) != null)
                {
                    this.m_currentHouse.deleteDoor((Door)this.m_selectedObject);
                }
                this.m_selectedObject = (PlaceableObject)null;
                break;
            }
            this.m_selectedObject = this.getObjectAt(this.m_activeTileX, this.m_activeTileY);
            break;

        case 4:
            int screenX2 = args[1];
            int screenY2 = args[2];
            this.m_startDragScreenX = screenX2;
            this.m_startDragScreenY = screenY2;
            this.m_prevActiveTileX  = this.m_activeTileX;
            this.m_prevActiveTileY  = this.m_activeTileY;
            this.coordScreenToTile(screenX2, screenY2, ref this.m_activeTileX, ref this.m_activeTileY);
            int mainEditButtonId2 = this.getMainEditButtonId(screenX2, screenY2);
            JSystem.println("Drag started in button w id " + (object)mainEditButtonId2);
            if (mainEditButtonId2 != -1 && mainEditButtonId2 != 4 && this.m_currentHouse != null)
            {
                switch (mainEditButtonId2)
                {
                case 0:
                    house.Room room1 = new house.Room(this.m_activeTileX, this.m_activeTileY, 2, 2, 0, 0);
                    this.m_currentHouse.addRoom(room1);
                    this.m_selectedObject = (PlaceableObject)room1;
                    break;

                case 1:
                    Door door1 = new Door(this.m_activeTileX, this.m_activeTileY, 1, 70);
                    this.m_currentHouse.addDoor(door1);
                    this.m_selectedObject = (PlaceableObject)door1;
                    break;

                case 2:
                    Window window1 = new Window(this.m_activeTileX, this.m_activeTileY, 1, 138);
                    this.m_currentHouse.addWindow(window1);
                    this.m_selectedObject = (PlaceableObject)window1;
                    break;

                case 3:
                    HouseObject @object = new HouseObject(this.m_activeTileX, this.m_activeTileY, this.m_prevAddedObjectType < 0 ? 82 : this.m_prevAddedObjectType, 1);
                    this.m_currentHouse.addHouseObject(@object);
                    this.m_selectedObject = (PlaceableObject)@object;
                    break;
                }
            }
            if (this.m_selectedObject == null)
            {
                break;
            }
            this.m_selectedObject.setPosition(this.m_selectedObject.getX() + this.m_activeTileX - this.m_prevActiveTileX, this.m_selectedObject.getY() + this.m_activeTileY - this.m_prevActiveTileY);
            break;

        case 5:
            int screenX3 = args[1];
            int screenY3 = args[2];
            this.m_prevActiveTileX = this.m_activeTileX;
            this.m_prevActiveTileY = this.m_activeTileY;
            this.coordScreenToTile(screenX3, screenY3, ref this.m_activeTileX, ref this.m_activeTileY);
            if (this.m_selectedObject == null)
            {
                break;
            }
            this.m_selectedObject.setPosition(this.m_selectedObject.getX() + (this.m_activeTileX - this.m_prevActiveTileX), this.m_selectedObject.getY() + (this.m_activeTileY - this.m_prevActiveTileY));
            break;

        case 6:
            JSystem.println("  single drag end");
            break;

        case 7:
            JSystem.println("  double tap");
            if (this.isDoubleTapHorizontal(args))
            {
                if (this.m_selectedObject == null)
                {
                    break;
                }
                this.editStateTransition(4);
                break;
            }
            this.editStateTransition(3);
            break;

        case 9:
            int  num1 = args[1];
            int  num2 = args[2];
            int  num3 = args[3];
            int  num4 = args[4];
            int  viewportHeight = this.m_simWorld.getViewportHeight();
            bool flag1 = num1 <40 && num2> viewportHeight - 40;
            bool flag2 = num1 <40 && num4> viewportHeight - 40;
            if ((!flag1 || flag2) && (flag1 || !flag2) || this.m_selectedObject == null)
            {
                break;
            }
            int screenX4 = flag1 ? num3 : num1;
            int screenY4 = flag2 ? num2 : num4;
            this.m_prevActiveTileX = this.m_activeTileX;
            this.m_prevActiveTileY = this.m_activeTileY;
            this.coordScreenToTile(screenX4, screenY4, ref this.m_activeTileX, ref this.m_activeTileY);
            house.Room room2   = house.Room.house_cast(this.m_selectedObject);
            Door       door2   = Door.house_cast(this.m_selectedObject);
            Window     window2 = Window.house_cast(this.m_selectedObject);
            int        num5    = this.m_activeTileX - this.m_prevActiveTileX;
            int        num6    = this.m_activeTileY - this.m_prevActiveTileY;
            if (room2 != null)
            {
                room2.setSize(JMath.max(1, room2.getWidth() + num5), JMath.max(1, room2.getHeight() + num6));
                break;
            }
            if (door2 != null)
            {
                door2.setSize(door2.getWidth() + num5, door2.getHeight());
                break;
            }
            window2?.setSize(JMath.min(2, window2.getWidth() + num5), window2.getHeight());
            break;
        }
    }
 private void UpdateValues(HouseObject item)
 {
     selectedHouseObject = item;
     nameArea.text       = item.houseItensSo.objectName;
     objectImage.sprite  = item.houseItensSo.objectSprite;
 }
예제 #19
0
    private void initStateEditAttributes()
    {
        this.m_lookupsFirstList               = (string[])null;
        this.m_numPagesFirstList              = 0;
        this.m_currPageFirstList              = 0;
        this.m_lookupSizeFirstList            = 0;
        this.m_lookupsSecondList              = (string[])null;
        this.m_numPagesSecondList             = 0;
        this.m_currPageSecondList             = 0;
        this.m_lookupSizeFirstList            = 0;
        this.m_currSelectionFirstList         = 0;
        this.m_currSelectionSecondList        = 0;
        this.m_currentFacingSelectionButtonId = -1;
        this.m_attrEditButtons[4].hide();
        this.m_attrEditButtons[5].hide();
        this.m_attrEditButtons[6].hide();
        this.m_attrEditButtons[7].hide();
        this.m_attrEditButtons[0].hide();
        this.m_attrEditButtons[2].hide();
        this.m_attrEditButtons[1].hide();
        this.m_attrEditButtons[3].hide();
        if (house.Room.house_cast(this.m_selectedObject) != null)
        {
            house.Room room = house.Room.house_cast(this.m_selectedObject);
            this.m_lookupsFirstList        = GlobalConstants.LOOKUP_FLOOR;
            this.m_lookupSizeFirstList     = this.m_simWorld.getFloorCount();
            this.m_currSelectionFirstList  = room.getFloor();
            this.m_lookupsSecondList       = GlobalConstants.LOOKUP_WALL;
            this.m_lookupSizeSecondList    = this.m_simWorld.getWallCount();
            this.m_currSelectionSecondList = room.getWall();
        }
        else if (Door.house_cast(this.m_selectedObject) != null)
        {
            Door door = Door.house_cast(this.m_selectedObject);
            this.m_lookupsFirstList       = GlobalConstants.LOOKUP_OBJECT;
            this.m_lookupSizeFirstList    = this.m_simWorld.getDoorTypeNthCount();
            this.m_currSelectionFirstList = this.m_simWorld.getObjectOfTypeIndexFromObjectArrayIndex(15, door.getType() == -1 ? 70 : door.getType());
            JSystem.println("door count = " + (object)this.m_lookupSizeFirstList);
        }
        else if (HouseObject.house_cast(this.m_selectedObject) != null)
        {
            HouseObject houseObject = HouseObject.house_cast(this.m_selectedObject);
            this.m_attrEditButtons[4].show();
            this.m_attrEditButtons[5].show();
            this.m_attrEditButtons[6].show();
            this.m_attrEditButtons[7].show();
            switch (houseObject.getFacing())
            {
            case 0:
                this.m_currentFacingSelectionButtonId = 4;
                break;

            case 1:
                this.m_currentFacingSelectionButtonId = 6;
                break;

            case 2:
                this.m_currentFacingSelectionButtonId = 5;
                break;

            case 3:
                this.m_currentFacingSelectionButtonId = 7;
                break;
            }
            this.m_lookupsFirstList    = GlobalConstants.LOOKUP_OBJECT;
            this.m_lookupSizeFirstList = this.m_simWorld.getBuildableNthCount();
            JSystem.println("object count = " + (object)this.m_lookupSizeFirstList);
            this.m_currSelectionFirstList = this.m_simWorld.getBuildableObjectIndexFromObjectArrayIndex(houseObject.getType());
        }
        else if (Window.house_cast(this.m_selectedObject) != null)
        {
            Window window = Window.house_cast(this.m_selectedObject);
            this.m_lookupsFirstList    = GlobalConstants.LOOKUP_OBJECT;
            this.m_lookupSizeFirstList = this.m_simWorld.getWindowTypeNthCount();
            JSystem.println("window count = " + (object)this.m_lookupSizeFirstList);
            this.m_currSelectionFirstList = this.m_simWorld.getObjectOfTypeIndexFromObjectArrayIndex(32, window.getType());
        }
        if (this.m_lookupsFirstList != null)
        {
            this.m_numPagesFirstList = 1 + (this.m_lookupSizeFirstList - 1) / this.m_numListRows;
            if (this.m_numPagesFirstList > 1)
            {
                this.m_attrEditButtons[1].show();
            }
        }
        if (this.m_lookupsSecondList == null)
        {
            return;
        }
        this.m_numPagesSecondList = 1 + (this.m_lookupSizeSecondList - 1) / this.m_numListRows;
        if (this.m_numPagesSecondList <= 1)
        {
            return;
        }
        this.m_attrEditButtons[3].show();
    }
예제 #20
0
 public void SetHouseObject(HouseObject houseObject)
 {
     houseObjectId    = houseObject.id;
     this.houseObject = houseObject;
 }
예제 #21
0
 public static void RemoveHouse(HouseObject obj)
 {
     _objects[(int)LAYER_ORDER.HOUSES].Remove(obj);
 }