Inheritance: MonoBehaviour
    private void TaskOnClick()
    {
        PartyActions.Sleep();
        if (Tent.Status == TentStatus.Fireplace)
        {
            PartyActions.DamageAllPlayers(1);
        }

        if (InventionStorage.IsAvailable(Invention.Cellar))
        {
            var food = FoodStorage.Food;
            FoodStorage.DecreaseFoodBy(food);
            FoodStorage.IncreasePermantFoodBy(food);
        }

        if (CampMoved)
        {
            Wall.HalfValue_Ceiling();
            Roof.HalfValue_Ceiling();
        }

        FoodStorage.DiscardFood();

        Destroy(popUp);
        var phaseView = FindObjectOfType <PhaseView>();

        phaseView.NextPhase();
        RoundSystem.instance.increaseRound();
    }
        public async void OnSaveRoof(object sender, EventArgs e)
        {
            try

            {
                IUserDialogs Dialogs = UserDialogs.Instance;
                Dialogs.ShowLoading("Saving...");
                await Task.Delay(2000);

                Repository repository = new Repository();
                Dialogs.HideLoading();


                Roof roof = new Roof();
                roof.PropertyAsset = new PropertyAsset();

                roof.IDPropertyAsset     = int.Parse(App.Current.Properties["PropertyId"].ToString());
                roof.Brand               = brandroof.Text;
                roof.Warranty            = warrantyroof.Text;
                roof.Description         = descripctionroof.Text;
                roof.Comments            = commentsroof.Text;
                roof.FFile               = fileNameroof;
                roof.IDUSERPropertyAsset = int.Parse(App.Current.Properties["UsersId"].ToString());
                repository.PostRoof(roof);

                GoToPage();
            }
            catch (Exception ex)
            {
                await DisplayAlert("Roof", ex.Message, "OK");
            }
        }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            Corp       = DrawCorp(Graphics.FromHwnd(pictureBox1.Handle));
            Roof       = DrawRoof(Graphics.FromHwnd(pictureBox1.Handle));
            BackWheel  = DrawWheel(Graphics.FromHwnd(pictureBox1.Handle));
            FrontWheel = DrawWheel(Graphics.FromHwnd(pictureBox1.Handle), 240);
            Lamp       = DrawLamp(Graphics.FromHwnd(pictureBox1.Handle));
            RoofDecor  = DrawRoofDecor(Graphics.FromHwnd(pictureBox1.Handle));

            for (var i = 0; i < 400; i++)
            {
                Thread.Sleep(12);
                Corp.Clear(BackColor);
                Roof.Clear(BackColor);
                BackWheel.Clear(BackColor);
                FrontWheel.Clear(BackColor);

                Corp       = DrawCorp(Corp, 0 + i);
                Roof       = DrawRoof(Roof, 75 + i);
                BackWheel  = DrawWheel(BackWheel, 50 + i, 190, i / 3);
                FrontWheel = DrawWheel(FrontWheel, 240 + i, 190, i / 3);
                Lamp       = DrawLamp(Lamp, 340 + i);
                RoofDecor  = DrawRoofDecor(RoofDecor, i);
            }
        }
Exemple #4
0
        public void RoofSlabShapePoints_Edit()
        {
            var elevation = 100;
            var level     = Level.ByElevation(elevation);

            var outline = new[]
            {
                Line.ByStartPointEndPoint(Point.ByCoordinates(0, 0, 0), Point.ByCoordinates(100, 0, 0)),
                Line.ByStartPointEndPoint(Point.ByCoordinates(100, 0, 0), Point.ByCoordinates(100, 100, 0)),
                Line.ByStartPointEndPoint(Point.ByCoordinates(100, 100, 0), Point.ByCoordinates(0, 100, 0)),
                Line.ByStartPointEndPoint(Point.ByCoordinates(0, 100, 0), Point.ByCoordinates(0, 0, 0))
            };

            var roofType = RoofType.ByName("Generic - 9\"");

            var roof = Roof.ByOutlineTypeAndLevel(outline, roofType, level);

            Assert.NotNull(roof);

            roof.AddPoint(Point.ByCoordinates(50, 50, 0));
            Assert.IsTrue(roof.Points.ToList().Count == 5);

            double elev = roof.Points.First().Z;

            roof.MovePoint(roof.Points.First(), 10);

            roof.Points.First().Z.ShouldBeApproximately(10 + elev);
        }
Exemple #5
0
    private void Start()
    {
        roofObject = GameObject.Find("Roofs");
        roof       = roofObject.GetComponent <Roof>();

        gameController = GameObject.Find("GameController").GetComponent <GameController>();
    }
 public void Destroye()
 {
     if (DisplayBlock)
     {
         //BuildingBlock block = Entity.GetComponent<BuildingBlock>();
         Entity.Kill();
     }
     if (Stair != null)
     {
         Stair.Destroye();
     }
     if (FloorFrame != null)
     {
         FloorFrame.Destroye();
     }
     if (LadderHatch != null)
     {
         LadderHatch.Destroye();
     }
     if (Roof != null)
     {
         Roof.Destroye();
     }
     foreach (Block wall in Walls)
     {
         wall.Destroye();
     }
 }
Exemple #7
0
        protected bool Build(Vector2 position)
        {
            int x = (int)position.x;
            int y = (int)position.y;

            ITile tile = board[x, y];

            if (possibleMoves[x, y])
            {
                // generate block or roof
                tile.Height++;
                if (board is Board)
                {
                    if (tile.Height == Height.ROOF)
                    {
                        Roof.GenerateRoof(x, y, board as Board, (int)tile.Height - 1);
                    }
                    else
                    {
                        Block.GenerateBlock(x, y, board as Board, (int)tile.Height - 1);
                    }
                }
                return(true);
            }
            return(false);
        }
Exemple #8
0
        private void createProject()
        {
            Basement basement = new Basement()
            {
                countPart = 1,
                price     = rnd.Next(),
                partName  = "basement",
                order     = 0
            };
            Roof roof = new Roof()
            {
                countPart = 1,
                price     = rnd.Next(),
                partName  = "roof",
                order     = 2
            };

            Wall wall = new Wall()
            {
                countPart = rnd.Next(4, 12),
                price     = rnd.Next(),
                partName  = "roof",
                order     = 1
            };

            parts.Add(basement);
            parts.Add(roof);
            parts.Add(wall);
        }
    void GenerateSegments(BuildingParams buildingParams, Material material, Transform parent)
    {
        foundation = new Foundation(material, parent, foundationParams, buildingParams);

        for (int i = 0; i < floorCount; i++)
        {
            if (i == 0)
            {
                bases[i] = new Base(ref baseParams[i], foundation.obj.transform, material, buildingParams, null);
                bases[i].GenerateDoor(baseParams[i].doorParams, material);
            }
            else
            {
                bases[i] = new Base(ref baseParams[i], bases[i - 1].obj.transform, material, buildingParams, baseParams[i - 1]);
            }


            bases[i].GenerateWindows(baseParams[i], material);
        }

        attic = new Attic(material, atticParams, bases[floorCount - 1].obj.transform);
        attic.GenerateWindows(material);

        roof = new Roof(material, baseParams[floorCount - 1], roofParams, bases[floorCount - 1].obj.transform);

        chimney = new Chimney(chimneyParams, material, roof.obj.transform);
    }
Exemple #10
0
        public void PostRoof(Roof roof)
        {
            System.Net.Http.HttpResponseMessage response = null;
            using (var Client = new System.Net.Http.HttpClient())
            {
                try
                {
                    var JSON      = Newtonsoft.Json.JsonConvert.SerializeObject(roof);
                    var content   = new StringContent(JSON, Encoding.UTF8, "text/json");
                    var URLWebAPI = "http://50.73.94.149/wsMaterialHouse/api/Roofs";
                    response = Client.PostAsync(URLWebAPI, content).Result;

                    //Debug.WriteLine(response.StatusCode);

                    //if (response.StatusCode != System.Net.HttpStatusCode.OK)
                    //{
                    //    throw new Exception();
                    //}
                }
                catch (Exception e)
                {
                    throw e;
                }
            }
        }
Exemple #11
0
 public static void MoveRoof(Roof roof, int x, int y, int height)
 {
     roof.transform.position =
         Vector3.right * (x + x * Tile.DISTANCE)
         - Vector3.down * height * 0.30f
         + Vector3.down * 0.2f
         + Vector3.forward * (y + y * Tile.DISTANCE) + Tile.OFFSET;
 }
        public void Setup()
        {
            _mockWindow = new Window();
            _mockRoof   = new Roof();
            _mockFloor  = new Floor();

            _houseBuilder = new HouseBuilder();
        }
 public void UpdateRoof(Roof roof)
 {
     using (var unitOfWork = new UnitOfWork())
     {
         unitOfWork.RoofRepository.Update(roof);
         unitOfWork.RoofRepository.Save();
     }
 }
 public void CreateRoof(Roof roof)
 {
     using (var unitOfWork = new UnitOfWork())
     {
         unitOfWork.RoofRepository.Insert(roof);
         unitOfWork.RoofRepository.Save();
     }
 }
Exemple #15
0
        public void BuildRoof()
        {
            IRoof roof = new Roof();

            roof.SetHeight(10);

            shop.SetRoof(roof);
        }
Exemple #16
0
 public RoofStyleCatalogResource(int APIversion, Stream unused, RoofStyleCatalogResource basis)
     : base(APIversion, basis.version, basis.common, basis.list)
 {
     this.common             = new Common(requestedApiVersion, OnResourceChanged, basis.common);
     this.roofType           = basis.roofType;
     this.catalogRoofPattern = basis.catalogRoofPattern;
     this.catalogWallStyle   = basis.catalogWallStyle;
     this.defaultSlope       = basis.defaultSlope;
     this.roofStyleFlags     = basis.roofStyleFlags;
 }
 public RoofStyleCatalogResource(int APIversion, Stream unused, RoofStyleCatalogResource basis)
     : base(APIversion, basis.version, basis.common, basis.list)
 {
     this.common = new Common(requestedApiVersion, OnResourceChanged, basis.common);
     this.roofType = basis.roofType;
     this.catalogRoofPattern = basis.catalogRoofPattern;
     this.catalogWallStyle = basis.catalogWallStyle;
     this.defaultSlope = basis.defaultSlope;
     this.roofStyleFlags = basis.roofStyleFlags;
 }
Exemple #18
0
    void OnTriggerExit2D(Collider2D collider)
    {
        Roof parentRoof = this.transform.parent.GetComponent <Roof>();

        if (collider.CompareTag("Player") && parentRoof.underRoof)
        {
            parentRoof.underRoof = false;
            //iTween.ColorTo(this.transform.parent.gameObject, iTween.Hash("time", .5f, "easeType", "easeInOutCubic", "a", 1f));
        }
    }
Exemple #19
0
 //Loads all the sprites once Unity is ready
 private void LoadSprites()
 {
     Dirt.LoadSprites();
     Ladder.LoadSprites();
     Bridge.LoadSprites();
     Trench.LoadSprites();
     Roof.LoadSprites();
     Platform.LoadSprites();
     BackgroundBlock.LoadSprites();
     Box.LoadSprites();
 }
 public RoofStyleCatalogResource(int APIversion, uint version,
     Common common, Roof roofType, uint catalogRoofStyle, uint catalogWallStyle, float defaultSlope, RoofStyle roofStyleFlags,
     TGIBlockList ltgib)
     : base(APIversion, version, common, ltgib)
 {
     this.common = new Common(requestedApiVersion, OnResourceChanged, common);
     this.roofType = roofType;
     this.catalogRoofPattern = catalogRoofStyle;
     this.catalogWallStyle = catalogWallStyle;
     this.defaultSlope = defaultSlope;
     this.roofStyleFlags = roofStyleFlags;
 }
Exemple #21
0
 public RoofStyleCatalogResource(int APIversion, uint version,
                                 Common common, Roof roofType, uint catalogRoofStyle, uint catalogWallStyle, float defaultSlope, RoofStyle roofStyleFlags,
                                 TGIBlockList ltgib)
     : base(APIversion, version, common, ltgib)
 {
     this.common             = new Common(requestedApiVersion, OnResourceChanged, common);
     this.roofType           = roofType;
     this.catalogRoofPattern = catalogRoofStyle;
     this.catalogWallStyle   = catalogWallStyle;
     this.defaultSlope       = defaultSlope;
     this.roofStyleFlags     = roofStyleFlags;
 }
 void Update()
 {
     if (Physics.Raycast(transform.position, transform.forward, out hit))
     {
         if (hit.collider.gameObject.tag == "Roof")
         {
             Roof roof = hit.collider.gameObject.GetComponent <Roof>();
             roof.cameraShouldView = true;
             roof.timerRoofSpawn   = 0f;
         }
     }
 }
Exemple #23
0
 // Start is called before the first frame update
 void Start()
 {
     //TODO: Initialize all the other stuff
     Roof.SetStartValue(0);
     Wall.SetStartState(0);
     WeaponPower.SetStartValue(0);
     Fur.SetStartValue(0);
     Wood.SetStartValue(0);
     FoodStorage.SetStartValue(0, 0);
     Moral.SetStartValue();
     TerrainStorage.CreateStorageSpace();
     InventionStorage.CreateStorageSpace();
 }
Exemple #24
0
 public House
 (
     IMaterial wallMaterial,
     IMaterial windowMaterial,
     IMaterial doorMaterial,
     IMaterial roofMaterial
 )
 {
     this.wall   = new Wall(wallMaterial);
     this.window = new Window(windowMaterial);
     this.door   = new Door(doorMaterial);
     this.roof   = new Roof(roofMaterial);
 }
 public override Roof GenerateRoof(BuildingSettings settings, RectInt bounds)
 {
     if (bounds.size.x == 1 && bounds.size.y == 1)
     {
         return(new Roof(RoofType.Point));
     }
     else
     {
         Roof roof = new Roof(RoofType.Peak);
         roof.IsDefault = true;
         return(roof);
     }
 }
Exemple #26
0
 public override Roof GenerateRoof(BuildingSettings settings, RectInt bounds)
 {
     if (bounds.size.x < bounds.size.y)
     {
         Roof roof = new Roof(RoofType.Peak);
         roof.IsDefault = true;
         return(roof);
     }
     else
     {
         return(new Roof(RoofType.Peak, RoofDirection.East));
     }
 }
Exemple #27
0
    // die Floor Shapes entscheiden von Fall zu Fall, ob es weitergeht, oder das Dach folgt
    public override void Expand()
    {
        float decide = Random.value;

        if (decide > 0.1f)
        {
            nextShape = new Floor(width, length, height);
            nextShape.Expand();
        }
        else
        {
            nextShape = new Roof(width, length, height);
        }
    }
Exemple #28
0
        /// <summary>
        /// Returns the index of the roof the character standing at the point
        /// ptx, pty.  -1 if no roof.
        /// </summary>
        /// <param name="ptx"></param>
        /// <param name="pty"></param>
        /// <returns></returns>
        private int CharInRoof(int ptx, int pty)
        {
            for (int i = 0; i < TheMap.Roofs.Count; i++)
            {
                Roof r = TheMap.Roofs[i];

                if (r.CharIn(ptx, pty, false))
                {
                    return(i);
                }
            }

            return(-1);
        }
Exemple #29
0
        public string InspectBuilding()
        {
            var toReturn = new StringBuilder();

            var electrical = new Electrical();
            var foundation = new Foundation();
            var plumbing   = new Plumbing();
            var roof       = new Roof();

            toReturn.AppendLine(electrical.InspectWiring());
            toReturn.AppendLine(foundation.InspectFoundation());
            toReturn.AppendLine(plumbing.InspectPlumbing());
            toReturn.AppendLine(roof.InspectRoof());

            return(toReturn.ToString());
        }
    public override Roof GenerateRoof(BuildingSettings settings, RectInt bounds)
    {
        for (int i = 0; i < strategies.Length; i++)
        {
            if (Random.Range(0f, 1f) > (1f - randomChance) && useRandom)
            {
                return(new Roof((RoofType)Random.Range(0, 3)));
            }
            Roof roof = strategies[i].GenerateRoof(settings, bounds);
            if (!roof.IsDefault)
            {
                return(roof);
            }
        }

        return(new Roof(RoofType.Peak));
    }
Exemple #31
0
 public House()
 {
     MyBasement = new Basement();
     MyWalls    = new Walls[4];
     for (int i = 0; i < MyWalls.Count(); i++)
     {
         MyWalls[i] = new Walls();
     }
     MyDoor   = new Door();
     MyWindow = new Window[4];
     for (int i = 0; i < MyWalls.Count(); i++)
     {
         MyWindow[i] = new Window();
     }
     MyRoof = new Roof();
     IsEnd  = false;
 }
        protected override void Parse(Stream s)
        {
            BinaryReader r = new BinaryReader(s);
            base.Parse(s);
            this.common = new Common(requestedApiVersion, OnResourceChanged, s);
            this.roofType = (Roof)r.ReadUInt32();
            this.catalogRoofPattern = r.ReadUInt32();
            this.catalogWallStyle = r.ReadUInt32();
            this.defaultSlope = r.ReadSingle();
            this.roofStyleFlags = (RoofStyle)r.ReadUInt32();

            list = new TGIBlockList(OnResourceChanged, s, tgiPosn, tgiSize);

            if (checking) if (this.GetType().Equals(typeof(RoofStyleCatalogResource)) && s.Position != s.Length)
                    throw new InvalidDataException(String.Format("Data stream length 0x{0:X8} is {1:X8} bytes longer than expected at {2:X8}",
                        s.Length, s.Length - s.Position, s.Position));
        }
Exemple #33
0
        public void createProject()
        {
            IPart pBasment = new Basement()
            {
                name  = "Basement",
                price = rnd.Next(0, 10000),
                count = 1,
                order = 1
            };
            IPart pWall = new Wall()
            {
                name  = "Wall",
                price = rnd.Next(0, 10000),
                count = 4,
                order = 2
            };
            IPart pWindow = new Window()
            {
                name  = "Window",
                price = rnd.Next(0, 10000),
                count = 4,
                order = 3
            };
            IPart pDoor = new Door()
            {
                name  = "Door",
                price = rnd.Next(0, 10000),
                count = 1,
                order = 4
            };
            IPart pRoof = new Roof()
            {
                name  = "Roof",
                price = rnd.Next(0, 10000),
                count = 1,
                order = 5
            };

            parts.Add(pBasment);
            parts.Add(pWall);
            parts.Add(pDoor);
            parts.Add(pRoof);
            parts.Add(pWindow);
        }