Example #1
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);
        }
Example #2
0
    void Start()
    {
        var audios = gameObject.GetComponents<AudioSource>();
        screamAudio = audios[1];

        npcPrefab = Resources.Load<NPC>("Prefabs/NPC");
        var basementPrefab = Resources.Load<Basement>("Prefabs/Basement");

        npcBodiesPrefabList = new List<GameObject>();

        for (int i = 0; i < 12; i++)
        {
            npcBodiesPrefabList.Add(Resources.Load<GameObject>("Prefabs/NPC/NPCBody_" + i));
        }

        basement = Instantiate<Basement>(basementPrefab);

        var respawners = basement.transform.FindChild("Respawners");

        npcs = new List<NPC>();

        respawnPoints = new List<Transform>();

        var allChildren = respawners.transform.Cast<Transform>().Select(t => t.gameObject).ToArray();
        foreach (GameObject t in allChildren)
        {
            respawnPoints.Add(t.transform);
        }
    }
Example #3
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Basement basement = await db.Basements.FindAsync(id);

            db.Products.Remove(basement);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Example #4
0
        public static void safe(int open)
        {
            if(open == 1)
            {
                WriteLine("You decide to try and open the safe.");

                // variables
                int attemptsLeft = 3;       // number of attempts to open the safe
                int safeCode = 7520;
                int enteredCode = 0;    // initialized

                while(attemptsLeft > 0)
                {
                    WriteLine("Enter the 4-digit code: ");
                    enteredCode = Int32.Parse(ReadLine());
                    if(enteredCode != safeCode)
                    {
    
                        WriteLine("Incorrect!");
                        attemptsLeft -= 1;
                        WriteLine("{0} attempts left.", attemptsLeft);
                        if(attemptsLeft == 0)
                        {
                            WriteLine("You have tried to open the safe 3 times and failed. As you start to turn around to leave, you feel several sharp, piercing points go into your back and side. On the opposite side of the room, 4 small openings are now evident on the wall. You almost immediately feel dizzy and heavy-limbed. You've been drugged or poisoned!");
                            WriteLine("You collapse to the ground, consciousness slipping away. You are still alive but you will be out of commission for quite awhile, as the sleeping poison works its way through your system. You hope that 'she' doesn't find you before you wake up....");

                            // 'end program' code
                        }
                    }
                    if(enteredCode == safeCode)
                    {
                        WriteLine("Correct!");

                        WriteLine("\nThe internal lock of the safe clicks open. You open the door and see 3 items: a folded piece of paper, a newspaper clip, and a large, sliver-plated GUN.");
                        WriteLine("The newspaper clip describes a murder that happened near this house: 5 people were brutally murdered, about 4 weeks ago. 2 bodies were hard to identify, due to the amount of damage inflicted.");
                        WriteLine("The folded piece of paper contains a hand-written message, in a tight, small, cursive hand: She killed them! She is cursed! If you find this, leave this house before it is too late!");
                        WriteLine("You take the clip but leave the note. You also take the GUN. Whoever 'she' is, it sounds like you might need the gun if you find her.");
                        WriteLine("You return your attention to the Entertainment Room. Press 'Enter' to continue.");
                        Console.ReadLine();
                        var weapon = 1;     // signifying that you found the Gun

                        Basement.entertainmentRoom();
                    }
                }
            }
            if(open == 2)
            {
                WriteLine("You decide to not press your luck and ignore the keypad on the safe.\n");
                WriteLine("Press 'Enter' to continue.");
                Console.ReadLine();
                Console.Clear();
                Basement.entertainmentRoom();
            }
        }
Example #5
0
        public async Task <ActionResult> Edit([Bind(Include = "ID,ProductNo,UnitNo,BaseNo,UnitArea,TotalContractPrice")] Basement basement)
        {
            if (ModelState.IsValid)
            {
                db.Entry(basement).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(basement));
        }
Example #6
0
        public async Task <ActionResult> Create([Bind(Include = "ID,ProductNo,UnitNo,BaseNo,UnitArea,TotalContractPrice")] Basement basement)
        {
            if (ModelState.IsValid)
            {
                db.Products.Add(basement);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(basement));
        }
        public void CreateWorks()
        {
            int c = rnd.Next(1, 3);

            for (int i = 0; i < c; i++)
            {
                Basement basement = new Basement();
                basement.Company  = "Asar";
                basement.Count    = 1;
                basement.Material = "-";
                basement.price    = rnd.Next();
                ListWork.Add(basement);
            }
            for (int i = 0; i < c * 4; i++)
            {
                Walls wall = new Walls();
                wall.Company  = ".";
                wall.Count    = 1;
                wall.Material = "kirpish";
                wall.SizeX    = 10;
                wall.SizeY    = 3;
                wall.price    = wall.SizeX * wall.SizeY * 15;
                wall.Color    = ConsoleColor.Gray;
                ListWork.Add(wall);
            }
            for (int i = 0; i < rnd.Next(2, c * 6); i++)
            {
                Window window = new Window();
                window.Company  = "--";
                window.Count    = 1;
                window.Material = "pistik";
                window.price    = rnd.Next(10000, 80000);
                window.SizeX    = 1000;
                window.SizeY    = 800;
                ListWork.Add(window);
            }
            for (int i = 0; i < c * 4; i++)
            {
                Door door = new Door();
                door.Company  = "IDver";
                door.Count    = 1;
                door.Material = "Baobab";
                door.SizeX    = 1800;
                door.SizeY    = 800;
                door.price    = 50000;
                ListWork.Add(door);
            }

            ListWork.Add(new Roof()
            {
                Count = 1, price = rnd.Next()
            });
        }
        public void CreateWorks()
        {
            int c = rnd.Next(1, 3);

            for (int i = 0; i < c; i++)
            {
                Basement basement = new Basement();
                basement.Company  = "Asar";
                basement.Count    = 1;
                basement.Material = "Beton";
                basement.Price    = rnd.Next();
                ListWork.Add(basement);
            }
            for (int i = 0; i < c * 4; i++)
            {
                Walls wall = new Walls();
                wall.Company  = "Asar";
                wall.Count    = 1;
                wall.Material = "Kirpich";
                wall.SizeX    = 10;
                wall.SizeY    = 12;
                wall.Price    = wall.SizeX * wall.SizeY * 15;
                wall.Color    = ConsoleColor.DarkYellow;
                ListWork.Add(wall);
            }
            for (int i = 0; i < rnd.Next(2, c * 6); i++)
            {
                Window window = new Window();
                window.Company  = "WindowBuild";
                window.Count    = 1;
                window.Material = "Plastik";
                window.Price    = rnd.Next(10000, 50000);
                window.SizeX    = 1000;
                window.SizeY    = 800;
                ListWork.Add(window);
            }
            for (int i = 0; i < c * 4; i++)
            {
                Door door = new Door();
                door.Company  = "DoorPrint";
                door.Material = "Wood";
                door.Count    = 1;
                door.SizeX    = 1800;
                door.SizeY    = 800;
                door.Price    = 50000;
                ListWork.Add(door);
            }
            ListWork.Add(new Roof()
            {
                Count = 1, Price = rnd.Next()
            });
        }
    private void CreateRoomsAndCorridors()
    {
        Basement    basement    = new Basement(Constants.BASEMENT);
        GroundStory groundStory = new GroundStory(Constants.GROUND_STORY);
        UpperStory  upperStory  = new UpperStory(Constants.UPPER_STORY);

        board.stories.Add(basement);
        board.stories.Add(groundStory);
        board.stories.Add(upperStory);

        groundStory.CreateRoomsAndCorridors(board);
        basement.CreateRoomsAndCorridors(board, groundStory.landing.stairwayDown, Verticality.Down);
        upperStory.CreateRoomsAndCorridors(board, groundStory.landing.stairwayUp, Verticality.Up);
    }
Example #10
0
        // GET: Products/Basements/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Basement basement = await db.Basements.FindAsync(id);

            if (basement == null)
            {
                return(HttpNotFound());
            }
            return(View(basement));
        }
Example #11
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;
 }
Example #12
0
 public static void kitchenSearch(int choice)
 {
     Console.Clear();
     switch (choice)
     {
         case 1:
             //oven
             WriteLine("You go to the oven. it's a standard gas stovetop-gas oven. You open the oven door and see... writing? ");
             WriteLine("In a red marker or paint, on the back wall, is a message:");
             WriteLine("She is cursed!");
             WriteLine("You don't know who 'she' is. You shut the oven door.");
             FirstFloor.kitchen();
             break;
         case 2:
             WriteLine("You walk up to the spot on the wall where the green glow is coming from. There's no heat or cold in the area, just the glow. You push on the wall but nothing happens.");
             WriteLine("You then notice a discolored spot on wall, a few feet to the left. You press on it, and a section of the wall swings open, revealing the green glow....");
             WriteLine("Multiple arms shoot from the glow! They grab onto your arms, you hair, anywhere that they can find a grip! You are yanked into the green light... and land in the front yard of another house. As you sit up, the front door of this house opens up and 3 figures - 2 women and a man - rush out to meet you.");
             WriteLine("'Thank goodness we snagged you in time!', one of the women exclaim. 'You are not prepared to take on what's in that house - come with us!', the man states. You follow them into the house, where you fate is put on hold until Part II....");
             break;
         case 3:
             //yellow glow - GOOD
             WriteLine("You walk up to the spot on the wall where the yellow glow is coming from. You don't see any kind of opening but you do see a small, slightly discolored spot on the wall, a few feet away. You push it and a stone slab slides down into an until-then unseen groove. Inside the opening is what appears to be a small altar or shrine. There are dozens of small, lit candles - the source of the yellow light. There is a medium-sized silver cross on top of a two-tiered table. There are smaller crosses on either end of the lower tier, set into bases. On the top tier is... a box of bullets?");
             WriteLine("You open the box and see 12 long, silver bullets. This is not a coincidence, you think to your self. You also realize that silver bullets need some kind of Gun to go with them... and possibly some target to use them on.");
             WriteLine("You take the box of bullets and leave the shrine, heading back into the kitchen.");
             WriteLine("Press 'Enter' to continue.");
             Console.ReadLine();
             FirstFloor.kitchen();
             break;
         case 4:
             Basement.stairs();
             break;
         case 5:
             WriteLine("You find some odds and ends: a couple of take-out menus, a few receipts, a newspaper. You don't see anything else of importance.");
             FirstFloor.kitchen();
             break;
         case 6:
             WriteLine("You leave the Kitchen and head back into the main Hall.");
             FirstFloor.hall();
             break;
         default:
             break;
     }
 } 
Example #13
0
    public void SelfPointerTestPasses()
    {
        Basement base_hp = new Basement(100.0f);
        Basement add_hp  = new Basement(15.0f);
        Modifier modi    = add_hp + base_hp;

        Debug.Log(modi.Value);
        bool exhp = false;

        try
        {
            modi.SetPartnerValue(modi);
            Debug.Log(modi.Value);
        }
        catch (StackOverflowException e)
        {
            exhp = true;
            Debug.Log(e.ToString());
        }
        Assert.IsTrue(exhp);
    }
Example #14
0
        public House(Team team)
        {
            IPart[] parts = new IPart[9] {
                new Wall(), new Wall(), new Wall(), new Wall(), new Window(), new Window(), new Door(), new Basement(), new Roof()
            };
            int i = 0;
            int j = 0;

            while (j < 9)
            {
                if (team.workers[i] is Brigadir)
                {
                    Console.WriteLine("already built: ");
                    for (int k = 0; k < j; k++)
                    {
                        Console.WriteLine(parts[k].GetType().ToString() + "  ");
                    }
                    i++;
                }
                else
                {
                    team.workers[i].buildnext(parts[j]);
                    j++;
                    i++;
                }
                if (i == team.workers.Length)
                {
                    i = 0;
                }
            }
            walls[0]   = (Wall)parts[0];
            walls[1]   = (Wall)parts[1];
            walls[2]   = (Wall)parts[2];
            walls[3]   = (Wall)parts[3];
            windows[0] = (Window)parts[4];
            windows[1] = (Window)parts[5];
            door       = (Door)parts[6];
            basement   = (Basement)parts[7];
            roof       = (Roof)parts[8];
        }
Example #15
0
 public void GameValueSpecialTestPasses()
 {
     FloatEqualityComparer fq = new FloatEqualityComparer(10e-8f);
     //测试结构体的运算符重载
     {
         Memoless mm   = new Memoless(22);
         Basement bs   = new Basement(25);
         Modifier sum1 = bs + mm;
         Modifier sum2 = mm + bs;
         Assert.IsTrue(fq.Equals(sum1.Value, 47.0f));
         Assert.IsTrue(fq.Equals(sum2.Value, 47.0f));
     }
     //对不可赋值的Modifier赋值
     {
         Modifier sum = (Memoless)23f + (Memoless)24;
         Assert.IsTrue(fq.Equals(sum.Value, 47.0f));
         bool excHapp = false;
         try
         {
             sum.Value = 4;
         }
         catch (NotImplementedException)
         {
             excHapp = true;
         }
         Assert.IsTrue(excHapp);
     }
     //交换功能
     {
         Basement bs1 = new Basement(1.0f);
         Basement bs2 = new Basement(2.0f);
         Modifier md  = bs1 - bs2;
         Assert.IsTrue(fq.Equals(md.Value, -1.0f));
         md.Swap();
         Assert.IsTrue(fq.Equals(md.Value, 1.0f));
     }
 }
Example #16
0
 public void deleteCar()
 {
     if (!FirstFlat.isEmpty())
     {
         bool flat = NextFlat();
         if (flat == true && !Basement.isEmpty())
         {
             FirstFlat.Remove();
             FirstFlat.Insert(Basement.Pop());
         }
         else if (flat == false && !SecondFlat.isEmpty())
         {
             FirstFlat.Remove();
             FirstFlat.Insert(SecondFlat.Remove().Data);
         }
         else
         {
             if (Basement.isEmpty() && SecondFlat.isEmpty())
             {
                 this.FirstFlat.Remove();
             }
         }
     }
 }
Example #17
0
 public void SetBasementToWanderAround(Basement basement)
 {
     movementStrategy = new NPCWanderStrategy(this, basement.transform, basement.GetRadius());
 }
Example #18
0
        public void CreateWorks()
        {
            //Basement basement = new Basement();
            //basement.Company = "Asar";
            //basement.Count = rnd.Next(1,3);
            //basement.Material = "-";
            // basement.Price = rnd.Next();

            int c  = rnd.Next(1, 3);
            int id = 0;

            for (int i = 0; i < c; i++)
            {
                Basement basement = new Basement();
                basement.WorkId   = id++;
                basement.Company  = "Asar";
                basement.Count    = 1;
                basement.Material = "-";
                basement.Price    = rnd.Next();
                ListWork.Add(basement);
            }

            for (int i = 0; i < c * 4; i++)
            {
                Walls wall = new Walls();
                wall.WorkId   = id++;
                wall.Company  = "-";
                wall.Count    = 1;
                wall.Material = " kirpish";
                wall.SizeX    = 10;
                wall.SizeY    = 3;
                wall.Price    = wall.SizeX * wall.SizeY * 15;
                wall.Color    = ConsoleColor.Gray;
                ListWork.Add(wall);
            }

            for (int i = 0; i < rnd.Next(2, c * 6); i++)
            {
                Window window = new Window();
                window.WorkId = id++;

                window.Company  = "--";
                window.Count    = 1;
                window.Material = "plstik";
                window.Price    = rnd.Next(10000, 80000);
                window.SizeX    = 1000;
                window.SizeY    = 800;
                ListWork.Add(window);
            }

            for (int i = 0; i < c * 4; i++)
            {
                Door door = new Door();
                door.WorkId = id++;

                door.Material = "derevo";
                door.Company  = "---";
                door.Count    = 1;
                door.SizeX    = 1800;
                door.SizeY    = 800;
                door.Price    = 50000;
                ListWork.Add(door);
            }

            ListWork.Add(new Roof()
            {
                WorkId = id, Count = 1, Price = rnd.Next()
            });
        }
Example #19
0
 void Awake()
 {
     instance = this;
 }
Example #20
0
    public void ModifierTestPasses()
    {
        //Debug.Log("ModifierTest:");
        //测试无记忆和修改器的搭配
        FloatEqualityComparer fq = new FloatEqualityComparer(10e-8f);
        Memoless meml1           = new Memoless(3.2f);
        Memoless meml2           = new Memoless(4.4f);
        Modifier modi1           = new Modifier(meml1, meml2, ModifyOperations.ADD);

        Debug.Log(modi1.Value);
        Assert.IsTrue(fq.Equals(modi1.Value, 7.6f));
        //无记忆是构造体,因此修改器构造时收到的实际上是副本
        meml1.Value = 4.4f;
        Assert.IsTrue(fq.Equals(modi1.Value, 7.6f));

        //测试地基和修改器的搭配
        Basement bas1  = new Basement(54.1f);
        Basement bas2  = new Basement(77.5f);
        Modifier modi2 = new Modifier(bas1, bas2, ModifyOperations.ADD);

        Assert.IsTrue(fq.Equals(modi2.Value, 131.6f));
        bas1.Value = 77.6f;
        Assert.IsTrue(fq.Equals(modi2.Value, 155.1f));
        bas2.Value = 1.0f;
        Assert.IsTrue(fq.Equals(modi2.Value, 78.6f));

        //测试修改器的自搭配
        Modifier modi3 = new Modifier(modi1, modi2, ModifyOperations.ADD);

        Assert.IsTrue(fq.Equals(modi3.Value, 86.2f));
        //Debug.Log(modi3.Value);
        bas2.Value = 2.0f;
        Assert.IsTrue(fq.Equals(modi3.Value, 87.2f));
        //Debug.Log(modi3.Value);

        //测试修改器对数值的重指向
        modi3.SetPartnerValue(new Memoless(3.3f));
        Assert.IsTrue(fq.Equals(modi3.Value, 10.9f));
        bas2.Value = 3.0f;
        Assert.IsTrue(fq.Equals(modi3.Value, 10.9f));

        //下面测试空指针回收功能
        Basement exteBas = new Basement(100.0f);

        Debug.Log(exteBas.BeReferredObjectsValues);
        {
            Modifier localModi  = new Modifier(new Memoless(50.0f), exteBas, ModifyOperations.ADD);
            Modifier localModi2 = new Modifier(localModi, exteBas, ModifyOperations.ADD);
            ; Debug.Log(exteBas.BeReferredObjectsValues);
            exteBas.Value = 150.0f;
            Debug.Log(localModi2.Value);
        }
        GC.Collect();
        exteBas.NeedReCalculate();
        exteBas.Value = 0;
        for (int i = 0; i < 1024; i++)
        {
            Modifier modi = new Modifier(new Memoless(50.0f), exteBas, ModifyOperations.ADD);
        }
        GC.Collect();
        //Debug.Log(exteBas.BeReferredObjectsValues);
        exteBas.Value = 0;
        Debug.Log(exteBas.BeReferredObjectsValues);
    }
Example #21
0
    public void HealthConstruction()
    {
        FloatEqualityComparer fq = new FloatEqualityComparer(10e-8f);
        //基础生命上限
        Basement base_health = new Basement(100.0f);
        //玩家等级
        Basement player_level = new Basement(15.0f);
        //每等级增加的生命值百分比
        Basement health_bonus_per_level = new Basement(0.02f);
        //来源于升级得到的生命上限加成
        Modifier upgradeParam           = new Modifier(player_level, health_bonus_per_level, ModifyOperations.MULTIPLY);
        Modifier healthBonusFromUpgrade = new Modifier(base_health, upgradeParam, ModifyOperations.MULTIPLY);
        //最终生命值
        Modifier finalHealth = new Modifier(base_health, healthBonusFromUpgrade, ModifyOperations.ADD);

        Debug.Log(finalHealth.Value);
        Assert.IsTrue(fq.Equals(finalHealth.Value, 130.0f));

        base_health.Value += 10.0f;
        Debug.Log("增加了10点基础生命值");
        Debug.Log(finalHealth.Value);
        Assert.IsTrue(fq.Equals(finalHealth.Value, 143.0f));

        player_level.Value += 10.0f;
        Debug.Log("增加了10点玩家等级");
        Debug.Log(finalHealth.Value);
        Assert.IsTrue(fq.Equals(finalHealth.Value, 165.0f));

        health_bonus_per_level.Value += 0.01f;
        Debug.Log("增加了1点每等级生命值加成百分比");
        Debug.Log(finalHealth.Value);
        Assert.IsTrue(fq.Equals(finalHealth.Value, 192.5f));

        //下面使用运算符重载后的特性重现上面内容
        Debug.Log("使用了运算符重载!");
        //基础生命上限
        Basement base_health2 = new Basement(100.0f);
        //玩家等级
        Basement player_level2 = new Basement(15.0f);
        //每等级增加的生命值百分比
        Basement health_bonus_per_level2 = new Basement(0.02f);

        Modifier finalHealth2 = base_health2 + (base_health2 * (player_level2 * health_bonus_per_level2));

        Debug.Log(finalHealth2.Value);
        Assert.IsTrue(fq.Equals(finalHealth2.Value, 130.0f));

        base_health2.Value += 10.0f;
        Debug.Log("增加了10点基础生命值");
        Debug.Log(finalHealth2.Value);
        Assert.IsTrue(fq.Equals(finalHealth2.Value, 143.0f));

        player_level2.Value += 10.0f;
        Debug.Log("增加了10点玩家等级");
        Debug.Log(finalHealth2.Value);
        Assert.IsTrue(fq.Equals(finalHealth2.Value, 165.0f));

        health_bonus_per_level2.Value += 0.01f;
        Debug.Log("增加了1点每等级生命值加成百分比");
        Debug.Log(finalHealth2.Value);
        Assert.IsTrue(fq.Equals(finalHealth2.Value, 192.5f));

        //重置两者数值为原值
        base_health.Value            = 100.0f;
        player_level.Value           = 15.0f;
        health_bonus_per_level.Value = 0.02f;
        Debug.Log(finalHealth.Value);
        Assert.IsTrue(fq.Equals(finalHealth.Value, 130.0f));

        base_health2.Value            = 100.0f;
        player_level2.Value           = 15.0f;
        health_bonus_per_level2.Value = 0.02f;
        Debug.Log(finalHealth2.Value);
        Assert.IsTrue(fq.Equals(finalHealth2.Value, 130.0f));
    }
Example #22
0
        public void CreateWorks()
        {
            int id = 0;
            int c  = rnd.Next(1, 3);

            for (int i = 0; i < c; i++)
            {
                Basement basement = new Basement();
                basement.WorkId   = id++;
                basement.Company  = "Bazis";
                basement.Count    = 1;
                basement.Material = "beton";
                basement.Price    = rnd.Next();
                ListWork.Add(basement);
            }

            for (int i = 0; i < c * 4; i++)
            {
                Walls walls = new Walls();
                walls.WorkId = id++;

                walls.Company  = "-";
                walls.Count    = 1;
                walls.Material = "kirpich";
                walls.SizeX    = 10;
                walls.SizeY    = 3;
                walls.Price    = walls.SizeX * walls.SizeY * 15;
                walls.Color    = ConsoleColor.Gray;
                ListWork.Add(walls);
            }


            for (int i = 0; i < c * rnd.Next(2, 6); i++)
            {
                Window windows = new Window();
                windows.WorkId = id++;

                windows.Company  = "-";
                windows.Count    = 1;
                windows.Material = "plastic";
                windows.SizeX    = 3;
                windows.SizeY    = 1.5;
                windows.Price    = rnd.Next(10000, 80000);
                ListWork.Add(windows);
            }

            for (int i = 0; i < c * 4; i++)
            {
                Door doors = new Door();
                doors.Company = "-";
                doors.WorkId  = id++;

                doors.Count    = 1;
                doors.Material = "wood";
                doors.SizeX    = 2.3;
                doors.SizeY    = 1.5;
                doors.Price    = rnd.Next(10000, 50000);
                ListWork.Add(doors);
            }

            ListWork.Add(new Roof()
            {
                Count = 1, Price = rnd.Next(), WorkId = id
            });
        }
Example #23
0
        //private Camera camera = null;

        void IBuildHouse.BuildHouse()
        {
            house = new House();

            int f = 1;

            for (int i = 0, k = 1; i < numberOfEntrances; i++)
            {
                entrance = new Entrance()
                {
                    Area             = 50.00,
                    EntranceNumber   = i + 1,
                    StatusOfCleaning = (StatusOfCleaning)rand.Next(0, 2),
                    Cameras          = new List <Camera>()
                    {
                        new Camera()
                        {
                            IpAdress        = "0.0.0.0",
                            Login           = "******",
                            Password        = "******",
                            Resolution      = 2.0,
                            EquipmentStatus = (EquipmentStatus)rand.Next(0, 2),
                            EntranceId      = i + 1
                        }
                    },
                    Lifts = new List <Lift>()
                    {
                        new Lift()
                        {
                            EquipmentStatus = (EquipmentStatus)rand.Next(0, 2),
                            EntranceId      = i + 1
                        }
                    },
                    Intercom = new Intercom()
                    {
                        EquipmentStatus = (EquipmentStatus)rand.Next(0, 2),
                        EntranceId      = i + 1
                    },
                    Lights = new List <Light>()
                    {
                        new Light()
                        {
                            Power           = 100,
                            EquipmentStatus = (EquipmentStatus)rand.Next(0, 2),
                            EntranceId      = i + 1
                        }
                    }
                };

                for (int j = 0; j < numberOfFloorsInEntrance; j++)
                {
                    hallway = new Hallway()
                    {
                        Area             = 10.45,
                        StatusOfCleaning = (StatusOfCleaning)rand.Next(0, 2)
                    };
                    hallway.Lights.Add(
                        new Light()
                    {
                        Power           = 40,
                        EquipmentStatus = (EquipmentStatus)rand.Next(0, 2),
                        HallwayId       = f++
                    });
                    ctx.Hallways.Add(hallway);

                    appartment = new Appartment()
                    {
                        AppartmentNumber  = k++,
                        Area              = 70.50,
                        StatusOfPremises  = StatusOfPremises.FREE,
                        NumberOfResidents = 0,
                        User              = null,
                        FloorId           = j + 1
                    };
                    ctx.Appartments.Add(appartment);

                    floor = new Floor();
                    floor.NumberOfFloor = j + 1;
                    floor.Hallway       = hallway;
                    floor.Appartments.Add(appartment);
                    entrance.Floors.Add(floor);

                    appartment = new Appartment()
                    {
                        AppartmentNumber  = k++,
                        Area              = 87.50,
                        StatusOfPremises  = StatusOfPremises.FREE,
                        NumberOfResidents = 0,
                        User              = null,
                        FloorId           = j + 2
                    };
                    ctx.Appartments.Add(appartment);
                    floor.Appartments.Add(appartment);

                    ctx.Floors.Add(floor);
                }

                ctx.Entrances.Add(entrance);
                house.Entrances.Add(entrance);
            }


            ///---------------------------------------------------------------------------------------------
            ///Cellar///
            ///---------------------------------------------------------------------------------------------
            for (int i = 0, k = 1; i < numberOfCellars; i++)
            {
                hallway = new Hallway()
                {
                    Area             = 18.60,
                    StatusOfCleaning = (StatusOfCleaning)rand.Next(0, 2),
                    Lights           = new List <Light>()
                    {
                        new Light()
                        {
                            Power           = 50,
                            EquipmentStatus = (EquipmentStatus)rand.Next(0, 2),
                            HallwayId       = f++
                        }
                    },
                    Cameras = new List <Camera>()
                    {
                        new Camera()
                        {
                            IpAdress        = "0.0.0.0",
                            Login           = "******",
                            Password        = "******",
                            Resolution      = 2.0,
                            EquipmentStatus = (EquipmentStatus)rand.Next(0, 2),
                            HallwayId       = f++
                        }
                    }
                };
                ctx.Hallways.Add(hallway);

                cellar = new Cellar()
                {
                    CellarNumber = i + 1,
                    Hallway      = hallway,
                };

                for (int j = 0; j < numberOfBasementsInCellar; j++)
                {
                    basement = new Basement()
                    {
                        Area             = 20.00,
                        BasementNumber   = k++,
                        StatusOfPremises = StatusOfPremises.FREE,
                        User             = null
                    };
                    ctx.Basements.Add(basement);
                    cellar.Basements.Add(basement);
                }

                ctx.Cellars.Add(cellar);
                house.Cellars.Add(cellar);
            }



            ///---------------------------------------------------------------------------------------------
            ///Parking Territory///
            ///---------------------------------------------------------------------------------------------
            parkingTerritory = new ParkingTerritory()
            {
                Area             = 360,
                StatusOfCleaning = (StatusOfCleaning)rand.Next(0, 2)
            };

            for (int i = 0; i < numberOfParkingPlaces; i++)
            {
                parkingPlace = new ParkingPlace()
                {
                    Area               = 15.00,
                    ParkingNumber      = i + 1,
                    StatusOfCleaning   = (StatusOfCleaning)rand.Next(0, 2),
                    StatusOfPremises   = StatusOfPremises.FREE,
                    User               = null,
                    ParkingTerritoryId = 1
                };
                ctx.ParkingPlaces.Add(parkingPlace);
                parkingTerritory.ParkingPlaces.Add(parkingPlace);
            }

            for (int i = 0; i < numberOfGarbagePlaces; i++, garbageCount++)
            {
                garbagePlace = new GarbagePlace()
                {
                    Area               = 5.00,
                    GarbageNumber      = i + 1,
                    StatusOfCleaning   = (StatusOfCleaning)rand.Next(0, 2),
                    ParkingTerritoryId = 1
                };
                ctx.GarbagePlaces.Add(garbagePlace);
                parkingTerritory.GarbagePlaces.Add(garbagePlace);
            }

            for (int i = 0; i < 2; i++)
            {
                Camera camera = new Camera()
                {
                    IpAdress           = "0.0.0.0",
                    Login              = "******",
                    Password           = "******",
                    Resolution         = 2.0,
                    EquipmentStatus    = (EquipmentStatus)rand.Next(0, 2),
                    ParkingTerritoryId = 1
                };
                ctx.Cameras.Add(camera);
                parkingTerritory.Cameras.Add(camera);
            }

            for (int i = 0; i < 2; i++)
            {
                Light light = new Light()
                {
                    Power              = 150,
                    EquipmentStatus    = (EquipmentStatus)rand.Next(0, 2),
                    ParkingTerritoryId = 1
                };
                ctx.Lights.Add(light);
                parkingTerritory.Lights.Add(light);
            }

            ctx.ParkingTerritories.Add(parkingTerritory);


            ///---------------------------------------------------------------------------------------------
            ///Play Ground///
            ///---------------------------------------------------------------------------------------------
            playGround = new PlayGround()
            {
                Area             = 200,
                StatusOfCleaning = (StatusOfCleaning)rand.Next(0, 2),
                Cameras          = new List <Camera>
                {
                    new Camera()
                    {
                        IpAdress        = "0.0.0.0",
                        Login           = "******",
                        Password        = "******",
                        Resolution      = 2.0,
                        EquipmentStatus = (EquipmentStatus)rand.Next(0, 2),
                        PlayGroundId    = 1
                    }
                },
                Lights = new List <Light>
                {
                    new Light()
                    {
                        Power           = 100,
                        EquipmentStatus = (EquipmentStatus)rand.Next(0, 2),
                        PlayGroundId    = 1
                    }
                },
                GarbagePlaces = new List <GarbagePlace>()
                {
                    new GarbagePlace()
                    {
                        Area             = 5.00,
                        GarbageNumber    = garbageCount++,
                        StatusOfCleaning = (StatusOfCleaning)rand.Next(0, 2),
                        PlayGroundId     = 1
                    },
                    new GarbagePlace()
                    {
                        Area             = 5.00,
                        GarbageNumber    = garbageCount++,
                        StatusOfCleaning = (StatusOfCleaning)rand.Next(0, 2),
                        PlayGroundId     = 1
                    }
                }
            };
            ctx.PlayGrounds.Add(playGround);

            ///---------------------------------------------------------------------------------------------
            ///Rest Territory///
            ///---------------------------------------------------------------------------------------------
            restTerritory = new RestTerritory()
            {
                Area             = 350,
                StatusOfCleaning = (StatusOfCleaning)rand.Next(0, 2),
                Cameras          = new List <Camera>()
                {
                    new Camera()
                    {
                        IpAdress        = "0.0.0.0",
                        Login           = "******",
                        Password        = "******",
                        Resolution      = 2.0,
                        EquipmentStatus = (EquipmentStatus)rand.Next(0, 2),
                        RestTerritoryId = 1
                    }
                },
                Lights = new List <Light>()
                {
                    new Light()
                    {
                        Power           = 100,
                        EquipmentStatus = (EquipmentStatus)rand.Next(0, 2),
                        RestTerritoryId = 1
                    }
                },
                GarbagePlaces = new List <GarbagePlace>()
                {
                    new GarbagePlace()
                    {
                        Area             = 5.00,
                        GarbageNumber    = garbageCount++,
                        StatusOfCleaning = (StatusOfCleaning)rand.Next(0, 2),
                        RestTerritoryId  = 1
                    },
                    new GarbagePlace()
                    {
                        Area             = 5.00,
                        GarbageNumber    = garbageCount++,
                        StatusOfCleaning = (StatusOfCleaning)rand.Next(0, 2),
                        RestTerritoryId  = 1
                    }
                }
            };
            ctx.RestTerritories.Add(restTerritory);

            ///---------------------------------------------------------------------------------------------
            ///Adjoining Territory///
            ///---------------------------------------------------------------------------------------------
            adjoiningTerritory = new AdjoiningTerritory()
            {
                Area             = 800,
                StatusOfCleaning = (StatusOfCleaning)rand.Next(0, 2),
                PlayGround       = playGround,
                RestTerritory    = restTerritory
            };
            ctx.AdjoiningTerritory.Add(adjoiningTerritory);


            ///---------------------------------------------------------------------------------------------
            ///Territory///
            ///---------------------------------------------------------------------------------------------
            territory = new Territory()
            {
                Area               = 1350,
                ParkingTerritory   = parkingTerritory,
                AdjoiningTerritory = adjoiningTerritory,
                StatusOfCleaning   = (StatusOfCleaning)rand.Next(0, 2),
                GarbagePlace       = new GarbagePlace()
                {
                    Area          = 20,
                    GarbageNumber = garbageCount++,
                    TerritoryId   = 1
                }
            };
            ctx.Territories.Add(territory);



            ///---------------------------------------------------------------------------------------------
            ///Company Data///
            ///---------------------------------------------------------------------------------------------
            companyData = new CompanyData()
            {
                Name   = "Managemrnt Company Ltd",
                Email  = "*****@*****.**",
                Phones = new List <string>()
                {
                    "063-12-12-665", "093-56-89-895"
                }
            };


            ///---------------------------------------------------------------------------------------------
            ///Company///
            ///---------------------------------------------------------------------------------------------
            company = new Company()
            {
                CompanyData = companyData,
            };
            company.Houses.Add(house);
            company.Territories.Add(territory);
            ctx.Companies.Add(company);

            byte[] passByte = Encoding.ASCII.GetBytes(HashMethods.HashMethods.GetHashString("qwer"));
            user = new User()
            {
                Login      = "******",
                Password   = passByte,
                FirstName  = "Mykola",
                LastName   = "Petro",
                Phone      = "066-564-51-23",
                BirthDate  = DateTime.Now,
                Email      = "*****@*****.**",
                UserStatus = UserStatus.ADMIN,
                CompanyId  = 1
            };
            ctx.Users.Add(user);
            company.Users.Add(user);

            passByte = Encoding.ASCII.GetBytes(HashMethods.HashMethods.GetHashString("qwer"));
            user     = new User()
            {
                Login      = "******",
                Password   = passByte,
                FirstName  = "Vasyl",
                LastName   = "Ivan",
                Phone      = "050-452-88-56",
                BirthDate  = DateTime.Now,
                Email      = "*****@*****.**",
                UserStatus = UserStatus.DIRECTOR,
                CompanyId  = 1
            };
            ctx.Users.Add(user);
            company.Users.Add(user);

            passByte = Encoding.ASCII.GetBytes(HashMethods.HashMethods.GetHashString("qwer"));
            user     = new User()
            {
                Login     = "******",
                Password  = passByte,
                FirstName = "Lena",
                LastName  = "Anya",
                Phone     = "050-636-31-23",
                BirthDate = DateTime.Now,
                //Email = "*****@*****.**",
                UserStatus = UserStatus.ACCOUNTANT,
                CompanyId  = 1
            };
            ctx.Users.Add(user);
            company.Users.Add(user);

            passByte = Encoding.ASCII.GetBytes(HashMethods.HashMethods.GetHashString("asdf"));
            user     = new User()
            {
                Login     = "******",
                Password  = passByte,
                FirstName = "Ivan",
                LastName  = "Petro",
                Phone     = "098-459-87-41",
                BirthDate = DateTime.Now,
                //Email = "*****@*****.**",
                UserStatus = UserStatus.JANITOR,
                CompanyId  = 1
            };
            ctx.Users.Add(user);
            company.Users.Add(user);

            passByte = Encoding.ASCII.GetBytes(HashMethods.HashMethods.GetHashString("asdf"));
            user     = new User()
            {
                Login     = "******",
                Password  = passByte,
                FirstName = "Valja",
                LastName  = "Nika",
                Phone     = "067-254-56-89",
                BirthDate = DateTime.Now,
                //Email = "*****@*****.**",
                UserStatus = UserStatus.JANITOR,
                CompanyId  = 1
            };
            ctx.Users.Add(user);
            company.Users.Add(user);



            /////---------------------------------------------------------------------------------------------
            /////Users///
            /////---------------------------------------------------------------------------------------------
            string[] names =
            { "Cate",         "Lida",  "Cherri",  "Dennis",  "Julia",  "Natalie",
              "Veronica", "Alice", "Pauline", "Pauline", "Arthur", "David", "Eugene" };
            string[] lastNames =
            {
                "George", "Victor", "Basil",    "Dennis", "Matthew", "Andrew",
                "Mark",   "Dave",   "Theodore", "Arthur", "David",   "Eugene"
            };
            string[] phoneCode = { "067", "050", "097", "066", "098", "0362" };



            for (int i = 1; i <= 30; i++)
            {
                string phoneNumber = phoneCode[rand.Next(0, 5)] + "-" + rand.Next(0, 9).ToString() + rand.Next(0, 9).ToString() + rand.Next(0, 9).ToString() +
                                     "-" + rand.Next(0, 9).ToString() + rand.Next(0, 9).ToString() + "-" + rand.Next(0, 9).ToString() + rand.Next(0, 9).ToString();

                passByte = Encoding.ASCII.GetBytes(HashMethods.HashMethods.GetHashString("user" + i.ToString()));
                user     = new User()
                {
                    Login     = "******",
                    Password  = passByte,
                    FirstName = names[rand.Next(0, names.Count())].ToString(),
                    LastName  = lastNames[rand.Next(0, lastNames.Count())].ToString(),
                    Phone     = phoneNumber,
                    BirthDate = DateTime.Now,
                    //Email = "*****@*****.**",
                    UserStatus = UserStatus.USER,
                    CompanyId  = 1
                };
                ctx.Users.Add(user);
                company.Users.Add(user);
            }
            ctx.SaveChanges();


            List <Appartment> appartments = ctx.Appartments.ToList();

            for (int i = 0, j = 6; i < 30; i++)
            {
                appartments[i].UserId            = j++;
                appartments[i].NumberOfResidents = rand.Next(1, 5);
                appartments[i].StatusOfPremises  = (StatusOfPremises)rand.Next(1, 3);
                ctx.Entry(appartments[i]).State  = System.Data.Entity.EntityState.Modified;
            }
            ctx.SaveChanges();

            List <ParkingPlace> parking = ctx.ParkingPlaces.ToList();

            for (int i = 0; i < 24; i++)
            {
                parking[i].UserId           = rand.Next(6, 36);
                parking[i].StatusOfPremises = (StatusOfPremises)rand.Next(1, 3);
                parking[i].StatusOfCleaning = (StatusOfCleaning)rand.Next(0, 2);
                ctx.Entry(parking[i]).State = System.Data.Entity.EntityState.Modified;
            }
            ctx.SaveChanges();
        }
        private string ToBasedString(Basement basement)
        {
            int  toBase;
            byte maxlength = GetMaxLength(this.valueType, basement);

            switch (basement)
            {
            case Basement.Bin:
                toBase = 2;
                break;

            case Basement.Oct:
                toBase = 8;
                break;

            case Basement.Dec:
                toBase = 10;
                break;

            case Basement.Hex:
                toBase = 16;
                break;

            default:
                throw new NotSupportedException(String.Format("Basement '{0}' not supported, supported values are: 2=Bin, 8=Oct, 10=Dec, 16=Hex", basement));
            }

            string result = string.Empty;

            switch (valueType)
            {
            case ValueType.Byte:
                result = Convert.ToString((byte)this.value, toBase);
                break;

            case ValueType.SByte:
                // no base sopport for sbyte
                //result = Convert.ToString((sbyte)this.value,basement);
                byte bval = (byte)this.value;
                result = Convert.ToString(bval, toBase);
                break;

            case ValueType.Short:
                result = Convert.ToString((short)this.value, toBase);
                break;

            case ValueType.UShort:
                // no base sopport for ushort
                //result = Convert.ToString((ushort)this.value,basement);
                short sval = (short)this.value;
                result = Convert.ToString(sval, toBase);
                break;

            case ValueType.Int:
                result = Convert.ToString((int)this.value, toBase);
                break;

            case ValueType.UInt:
                // no base sopport for uint
                //result = Convert.ToString((uint)this.value,basement);
                int ival = (int)this.value;
                result = Convert.ToString(ival, toBase);
                break;

            case ValueType.Long:
                result = Convert.ToString((long)this.value, toBase);
                break;

            case ValueType.ULong:
                // no base sopport for ulong
                //result = Convert.ToString((ulong)this.value,basement);
                long lval = (long)this.value;
                result = Convert.ToString(lval, toBase);
                break;

            default:
                throw new NotSupportedException(String.Format("valueType '{0}' not supported, supported values are: 0=SByte, 1=Byte, 2=Short, 3=UShort, 4=Int, 5=UInt, 6=Long, 7=ULong", valueType));
            }


            switch (basement)
            {
            case Basement.Bin:
                result = result.PadLeft(maxlength, '0');
                break;

            case Basement.Oct:
                result = result.PadLeft(maxlength, '0');
                break;

            case Basement.Dec:
                result = string.Format(string.Concat("{0:D", maxlength, "}"), this.value);
                break;

            case Basement.Hex:
                result = result.ToUpper().PadLeft(maxlength, '0');
                //result = string.Format(string.Concat("{0:X",maxlength,"}"), this.value); // cuz of type long, strange behaviour
                break;

            default:
                throw new NotSupportedException(String.Format("Basement '{0}' not supported, supported values are: 2=Bin, 8=Oct, 10=Dec, 16=Hex", basement));
            }

            return(result);
        }
 private byte GetMaxLength(ValueType valType, Basement basement)
 {
     return(MaxLength[(int)valueType, (int)basement]);
 }
Example #26
0
 public House(Basement basement, Roof roof, Storey storey)
 {
     this.Basement = basement;
     this.Roof     = roof;
     this.Storey   = storey;
 }
Example #27
0
        public void BuildBasement(House house)
        {
            var basement = new Basement(Name);

            basement.Construct(house);
        }
Example #28
0
        public House BuildHouse(House house = null)
        {
            string material_ = "";
            string material  = "";

            int counter;

            house = house ?? new House();
            if (!house.isTrueBasement())
            {
                counter = 1;
                while (true)
                {
                    Console.Clear();
                    Console.WriteLine("Виберіть тип фундаменту:");
                    if (counter == 1)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                    }
                    Console.WriteLine($"{(int)Basements.strich+1}. Стрічковий тип");
                    Console.ResetColor();
                    if (counter == 2)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                    }
                    Console.WriteLine($"{(int)Basements.zbirn + 1}. Збірний тип");
                    Console.ResetColor();

                    if (counter == 3)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                    }
                    Console.WriteLine($"{((int)Basements.stovpch) + 1}. Стовпчастий тип");
                    Console.ResetColor();

                    if (counter == 4)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                    }
                    Console.WriteLine($"{((int)Basements.suc) + 1}. Суцільний тип");
                    Console.ResetColor();

                    if (counter == 5)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                    }
                    Console.WriteLine($"{((int)Basements.vareniy) + 1}. Варений тип");
                    Console.ResetColor();

                    ConsoleKeyInfo info = Console.ReadKey();
                    ConsoleKey     key  = info.Key;
                    if (key == ConsoleKey.DownArrow && counter <= 5)
                    {
                        counter++;
                        counter = counter == 6 ? counter = 1 : counter;
                    }
                    else if (key == ConsoleKey.UpArrow && counter >= 1)
                    {
                        counter--;
                        counter = counter == 0 ? counter = 5 : counter;
                    }
                    else if (key == ConsoleKey.Enter)
                    {
                        break;
                    }
                }
                int typeBasement = counter - 1;
                material = "";
                switch (typeBasement)
                {
                case 0: { material = "Стрічковий"; break; }

                case 1: { material = "Збірний"; break; }

                case 2:
                { material = "Стовпчастий"; break; }

                case 3:
                { material = "Суцільний"; break; }

                case 4:
                { material = "Варений"; break; }
                }
                tm.typeBasement = typeBasement;
            }
            if (!house.isTrueDoor())
            {
                counter = 1;
                while (true)
                {
                    Console.Clear();
                    Console.WriteLine("Виберіть тип дверей:");
                    if (counter == 1)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                    }
                    Console.WriteLine($"{(int)Doors.sklo + 1}. скляні двері");
                    Console.ResetColor();
                    if (counter == 2)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                    }
                    Console.WriteLine($"{(int)Doors.metal + 1}. Металічні двері");
                    Console.ResetColor();

                    if (counter == 3)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                    }
                    Console.WriteLine($"{(int)Doors.derevo + 1}. Дерев'яні двері");
                    Console.ResetColor();

                    if (counter == 4)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                    }
                    Console.WriteLine($"{(int)Doors.profil + 1}. Профільні двері");
                    Console.ResetColor();



                    ConsoleKeyInfo info = Console.ReadKey();
                    ConsoleKey     key  = info.Key;
                    if (key == ConsoleKey.DownArrow && counter <= 4)
                    {
                        counter++;
                        counter = counter == 5 ? counter = 1 : counter;
                    }
                    else if (key == ConsoleKey.UpArrow && counter >= 1)
                    {
                        counter--;
                        counter = counter == 0 ? counter = 4 : counter;
                    }
                    else if (key == ConsoleKey.Enter)
                    {
                        break;
                    }
                }
                int typeDoor = counter - 1;
                material_ = "";
                switch (typeDoor)
                {
                case 0: { material_ = "Скло"; break; }

                case 1: { material_ = "Метал"; break; }

                case 2: { material_ = "Дерево"; break; }

                case 3: { material_ = "Профіль"; break; }
                }
                tm.typeDoor = typeDoor;
            }
            ConsoleKeyInfo info_;
            ConsoleKey     key_;

            if (!tm.IsBasement())
            {
                Console.WriteLine("Продовжити жміть Ентер\nв іншому випадку іншу кнопку");
                info_ = Console.ReadKey();
                key_  = info_.Key;
                if (key_ != ConsoleKey.Enter)
                {
                    return(house);
                }

                Basement bs = new Basement(material);
                house.AddBasement(bs);
                tm.ReadyBasement();
            }

            if (!tm.IsWalls())
            {
                Console.WriteLine("Продовжити жміть Ентер\nв іншому випадку іншу кнопку");
                info_ = Console.ReadKey();
                key_  = info_.Key;
                if (key_ != ConsoleKey.Enter)
                {
                    return(house);
                }


                //Add Walls
                Wall w1 = new Wall();
                house.AddWall(w1);
                Wall w2 = new Wall();
                house.AddWall(w2);
                Wall w3 = new Wall();
                house.AddWall(w3);
                Wall w4 = new Wall();
                house.AddWall(w4);
                tm.ReadyWalls();
            }

            if (!tm.IsDoor())
            {
                Console.WriteLine("Продовжити жміть Ентер\nв іншому випадку іншу кнопку");
                info_ = Console.ReadKey();
                key_  = info_.Key;
                if (key_ != ConsoleKey.Enter)
                {
                    return(house);
                }

                //Add Door
                Door door = new Door(material_);
                house.AddDoor(door);
                tm.ReadyDoor();
            }

            if (!tm.IsWindows())
            {
                Console.WriteLine("Продовжити жміть Ентер\nв іншому випадку іншу кнопку");
                info_ = Console.ReadKey();
                key_  = info_.Key;
                if (key_ != ConsoleKey.Enter)
                {
                    return(house);
                }

                //Add Window
                Window w1_ = new Window();
                house.AddWindow(w1_);
                Window w2_ = new Window();
                house.AddWindow(w2_);
                Window w3_ = new Window();
                house.AddWindow(w3_);
                Window w4_ = new Window();
                house.AddWindow(w4_);
                tm.ReadyWindow();
            }

            if (!tm.IsPart())
            {
                Console.WriteLine("Продовжити жміть Ентер\nв іншому випадку іншу кнопку");
                info_ = Console.ReadKey();
                key_  = info_.Key;
                if (key_ != ConsoleKey.Enter)
                {
                    return(house);
                }

                //Add Part
                Part part = new Part();
                house.AddPart(part);
                tm.ReadyPart();
            }



            return(house);
        }
Example #29
0
        public static void entRoomSearch(int choice)
        {        
            switch(choice)
            {
                case 1:
                {    
                    // Chamber - FINAL BATTLE(S)
                    Console.Clear();
                    WriteLine("You approach the large metal door; upon closer inspection, you see that the door is very thick and made of iron.\nAnd it’s a good thing because you hear a bellow from the other side of the door that is not remotely human.\nDespite that, you decide to open the door.");
                    WriteLine("Press 'Enter' to continue.");
                    Console.ReadLine();
                    Console.Clear();
                    WriteLine("You see a very large room, mostly empty - basically a chamber. Most of the walls are stone.\nIn front of the far wall is a table, possibly an altar, covered by some kind of dark purple cloth, trimmed in silver.\nOn that table are some leather-bound books and a couple of silver candle holders; there are tall, twin lit candles in each holder.");
                    WriteLine("Press 'Enter' to continue.");
                    Console.ReadLine();
                    Console.Clear();
                    WriteLine("You notice chalk or charcoal sketches on the left and right walls, on the inside of the door, and a very large drawing in front of the table.\nThese appear to be some form of Protection glyphs that you may have seen in a pamphlet earlier. \nThey consist of a triangle, small circles drawn around the points of the triangle, and a large circle surrounding the triangle-circle figure. The one on the floor is drawn in black and white chalk, is about 10-12 feet in diameter, and surrounds a monstrosity.");
                    WriteLine("Press 'Enter' to continue.");
                    Console.ReadLine();
                    Console.Clear();
                    WriteLine("Inside the floor glyph, in front of the table, stands a gaunt, humanoid figure, well over 7 feet tall. The tattered remains of pants and shoes cling to the lower body of the figure.\nThe upper body is lean muscle, covered by a sleek, grey coat of fur. The head… it LOOKS vaguely like a wolf, if a slightly feminine face was put on a wolf head and muzzle, and the jaws were about three times too wide and long.");
                    
                    WriteLine("Press 'Enter' to continue.");
                    Console.ReadLine();
                    Console.Clear();

                    WriteLine("THIS is the source of the strange occurrences in this house.");
                    WriteLine("This is a Loup-Garou!");
                    
                    // more code
                    WriteLine("Press 'Enter' to continue.");
                    Console.ReadLine();

                    BossEncounter.battleNoLocket();
                }    
                    break;
                case 2:
                    Console.WriteLine("There are bottles of various liquors behind the bar but nothing else of interest.");
                    WriteLine("Press 'Enter' to continue.");
                    Console.ReadLine();
                    Console.Clear();
                    Basement.entertainmentRoom();
                    break;
                case 3:
                    // bathroom2
                    WriteLine("This bathroom is surprisngly intact, compare to other parts of the house. You don't find anything of interest.");
                    WriteLine("Press 'Enter' to continue.");
                    Console.ReadLine();
                    Console.Clear();
                    Basement.entertainmentRoom();
                    // link back to Ent. Room
                    break;
                case 4:
                {   
                    WriteLine("You take a closer look at the safe. Under the numerical keypad, there is a hand-written strip of paper: 'You only get 3 chances'.");
                    WriteLine("Do you try to enter the code?");
                    WriteLine("1. Yes, 2. No");
                    int safeOpen = Int32.Parse(ReadLine());
                    
                    safe(safeOpen);                    
                    break;
                }    
                case 5:
                    Basement.stairs();
                    break;
                default:
                    break;
            }
        }
Example #30
0
 //фундамент
 public void SetBasement()
 {
     basement1      = new Basement();
     basement_exist = true;
 }
 public void BuildBasement()
 {
     this._basement = new Basement();
     Console.WriteLine("Подвал построен");
 }