Beispiel #1
0
    private bool Dzialania(int cel_x, int cel_y, Okreslenie_Pola cel)
    {
        Okreslenie_Pola stan = Okreslenie_Pola.None;

        stan = _CurrentCell.plansza.Sprawdzenie_Pola(cel_x, cel_y, this);
        if (stan == cel)
        {
            _Podswietlone_Pola.Add(_CurrentCell.plansza.AllCells[cel_x, cel_y]);
            return(true);
        }
        return(false);
    }
Beispiel #2
0
    private bool Dzialania(int cel_x, int cel_y)
    {
        Okreslenie_Pola stan = Okreslenie_Pola.None;

        stan = _CurrentCell.plansza.Sprawdzenie_Pola(cel_x, cel_y, this);

        if (stan != Okreslenie_Pola.Przyjaciel && stan != Okreslenie_Pola.Za_Plansza)
        {
            _Podswietlone_Pola.Add(_CurrentCell.plansza.AllCells[cel_x, cel_y]);
            return(true); //zwraca gdy można tam wykonać ruch
        }
        return(false);
    }
Beispiel #3
0
    private void Sprawdz_Promocje()
    {
        int aktualne_x = _CurrentCell.Pozycja_Planszy.x;
        int aktualne_y = _CurrentCell.Pozycja_Planszy.y;

        Okreslenie_Pola pole = _CurrentCell.plansza.Sprawdzenie_Pola(aktualne_x, aktualne_y + _Ruch.y, this);

        if (pole == Okreslenie_Pola.Za_Plansza)
        {
            Color kolor_Figury = GetComponent <Image>().color;
            _Menager_Figur.Promowanie_Figury(this, _CurrentCell, kolor, kolor_Figury);
        }
    }
Beispiel #4
0
    private void Tworzenie_Ruchu(int kierunek_x, int kierunek_y, int ruch, List <PossibleMove> possibleMoves = null)
    {
        // pozycja
        int aktualne_x = _CurrentCell.Pozycja_Planszy.x;
        int aktualne_y = _CurrentCell.Pozycja_Planszy.y;


        //sprawdzenie wszystkich pól
        for (int i = 1; i <= ruch; i++)
        {
            aktualne_x += kierunek_x;
            aktualne_y += kierunek_y;

            // Ustawianie stanu
            Okreslenie_Pola okreslenie_Pola = Okreslenie_Pola.None;
            okreslenie_Pola = _CurrentCell.plansza.Sprawdzenie_Pola(aktualne_x, aktualne_y, this);

            //jesli wrog zapisz i zerwij petle
            if (okreslenie_Pola == Okreslenie_Pola.Wrog)
            {
                _Podswietlone_Pola.Add(_CurrentCell.plansza.AllCells[aktualne_x, aktualne_y]);
                if (possibleMoves != null)
                {
                    possibleMoves.Add(new PossibleMove(_CurrentCell.Pozycja_Planszy.x, _CurrentCell.Pozycja_Planszy.y, aktualne_x, aktualne_y));
                }
                czy_ma_jakikolwiek_ruch = true;
                break;
            }
            // jesli nie jest wolne zerwij petle
            if (okreslenie_Pola != Okreslenie_Pola.Wolne)
            {
                break;
            }

            // pozostałe dodajemy do listy
            _Podswietlone_Pola.Add(_CurrentCell.plansza.AllCells[aktualne_x, aktualne_y]);
            if (possibleMoves != null)
            {
                possibleMoves.Add(new PossibleMove(_CurrentCell.Pozycja_Planszy.x, _CurrentCell.Pozycja_Planszy.y, aktualne_x, aktualne_y));
            }
            czy_ma_jakikolwiek_ruch = true;
        }
    }