Android Open Source - RUflow Cellpath






From Project

Back to project page RUflow.

License

The source code is released under:

GNU General Public License

If you think the Android project RUflow listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package is.ru.app;
/*w ww  . java 2s. com*/
import android.util.Log;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by olafurn on 9.9.2014.
 */


public class Cellpath {

    private ArrayList<Coordinate> m_path = new ArrayList<Coordinate>();
    private int color;
    public void append( Coordinate co ) {
        int idx = m_path.indexOf(  co );
        if ( idx >= 0 ) {
            for ( int i=m_path.size()-1; i > idx; --i ) {
                m_path.remove(i);
            }
        }
        else {
            m_path.add(co);
        }
    }

    public void trim(Coordinate co) {
        int idx = m_path.indexOf(co);

        if(idx >= 0)
        {
            for(int i = m_path.size()-1; i > idx; --i)
            {
                m_path.remove(i);
            }

        }
    }

    public void conflict(Coordinate co)
    {
        int idx = m_path.indexOf(co);

        if(idx >= 0)
        {
            for(int i = m_path.size()-1; i > idx; --i)
            {
                m_path.remove(i);

            }
        }
        if(m_path.size() > 1)
        {
            m_path.remove(m_path.size()-1);
        }
        else
        {
            reset();
        }

    }

    public List<Coordinate> getCoordinates() {
        return m_path;
    }

    public void reset() {
        m_path.clear();
    }

    public boolean isEmpty() {
        return m_path.isEmpty();
    }

    //Btti essu vi hrna en g held a a urfi a tfra etta annarstaar.
    public void setColor(int color){this.color = color;}
    public int getColor(){ return color; }

}




Java Source Code List

is.ru.app.Board.java
is.ru.app.Cellpath.java
is.ru.app.ColorListActivity.java
is.ru.app.Coordinate.java
is.ru.app.DbHelper.java
is.ru.app.FlowDbAdapter.java
is.ru.app.Global.java
is.ru.app.MainActivity.java
is.ru.app.MapPack.java
is.ru.app.Pack.java
is.ru.app.PlayActivity.java
is.ru.app.PuzzleSelectActivity.java
is.ru.app.Puzzle.java
is.ru.app.SelectActivity.java
is.ru.app.SuperPath.java