Exemplo n.º 1
0
 private bool TestPunkt(punkt test, string new_o)
 {
     if (new_o == "okno" || new_o == "drzwi_front")
     {
         if (test.isWall == false || test.isDoubleWall == true || test.isWindow == true || test.isCorner == true || test.isDoor == true)
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
     else if (new_o == "drzwi")
     {
         if (test.isWall == false || test.isDoubleWall == false || test.isWindow == true || test.isCorner == true || test.isDoor == true)
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 2
0
    private void CheckPlaceFor(string new_o)
    {
        Debug.Log("CheckPlaceFor " + new_o);
        int width = 0;

        if (new_o == "okno")
        {
            width = Game_kontroler.WindowWidth;
        }
        else if (new_o == "drzwi" || new_o == "drzwi_front")
        {
            width = Game_kontroler.DoorWidth;
        }

        bool sprawdzenie = true;

        for (int i = 1; i < width; i++)
        {
            punkt test = punktyCls.tablica_punktow[x + i, y];
            if (TestPunkt(test, new_o) == false)
            {
                sprawdzenie = false;
                break;
            }
        }
        if (sprawdzenie == false)
        {
            sprawdzenie = true;
            for (int i = 1; i < width; i++)
            {
                punkt test = punktyCls.tablica_punktow[x, y + i];
                if (TestPunkt(test, new_o) == false)
                {
                    sprawdzenie = false;
                    break;
                }
            }
            if (sprawdzenie)
            {
                PlaceOnOff(1, true, new_o);
            }
        }
        else
        {
            PlaceOnOff(0, true, new_o);
        }
    }