示例#1
0
        // Everything with floors
        // Add Floors if there are no floors in the database
        public static void AddFloorsForFirstRun()
        {
            int count = DatabaseController.GetFloorMaterial().Count;

            Console.WriteLine(count);
            if (count == 0)
            {
                FloorMaterial wood      = new FloorMaterial("Hout");
                FloorType     woodType  = new FloorType("Regulier", (float)19.95, Resources.WoodFloor);
                FloorType     woodType2 = new FloorType("Parket", (float)19.95, Resources.parket);
                FloorType     woodType3 = new FloorType("Klein", (float)19.95, Resources.SmallerPlank);
                FloorType     woodType4 = new FloorType("Donker", (float)19.95, Resources.DarkerPlank);

                woodType.floorMaterial  = wood;
                woodType2.floorMaterial = wood;
                woodType3.floorMaterial = wood;
                woodType4.floorMaterial = wood;
                FloorMaterial steen = new FloorMaterial("Steen");

                using (var mc = new MyContext())
                {
                    mc.floorMaterial.Add(wood);
                    mc.floorMaterial.Add(steen);

                    mc.floorType.Add(woodType);
                    mc.floorType.Add(woodType2);
                    mc.floorType.Add(woodType3);
                    mc.floorType.Add(woodType4);
                    mc.SaveChanges();
                }
                floorMaterialList = GetFloorMaterial();
                floorTypeList     = GetFloorType();
            }
        }
示例#2
0
        public void SetEditedMaterial(FloorMaterial material)
        {
            topTextureButton.Text    = material.Top.Name;
            bottomTextureButton.Text = material.Bottom.Name;

            materialEditPreview.TopTexture    = material.Top.Copy();
            materialEditPreview.BottomTexture = material.Bottom.Copy();

            topColorButton.BackColor     = material.Top.Color;
            materialEditPreview.TopColor = material.Top.Color;  //Why only for the top one?
            bottomColorButton.BackColor  = material.Bottom.Color;

            topAlphaBox.Text    = material.Top.Alpha.ToString();
            bottomAlphaBox.Text = material.Bottom.Alpha.ToString();
        }
    public void ChangeFloorMaterial(FloorMaterial floorMaterial)
    {
        GameFacade.Instance.StopNormalSound(_AudioSource);

        _FloorMaterial = floorMaterial;
    }
 public void ChangeMaterial(FloorMaterial material)
 {
     this.material = material;
 }
        public FloorMaterial CreateMaterial(string name)
        {
            FloorMaterial material = new FloorMaterial(name, top, bottom);

            return(material);
        }