Package com.tinygo.logic

Examples of com.tinygo.logic.Group


            boolean notify;
            int pos = game.board.pos(cursorX, cursorY);
            if (game.board.get(pos) == Board.NONE) {
                notify = super.doPlay();
            } else {
                Group group = new Group(game.board.maxPos());
                game.board.getGroup(pos, group);
                if (game.board.isBit(pos, Board.M_CAPTURED))
                    game.board.clearBit(group, Board.M_CAPTURED);
                else
                    game.board.setBit(group, Board.M_CAPTURED);
View Full Code Here


            boolean notify;
            int pos = game.board.pos(cursorX, cursorY);
            if (game.board.get(pos) == Board.NONE) {
                notify = super.doPlay();
            } else {
                Group group = new Group(game.board.maxPos());
                game.board.getGroup(pos, group);
                if (game.board.isBit(pos, Board.M_CAPTURED))
                    game.board.clearBit(group, Board.M_CAPTURED);
                else
                    game.board.setBit(group, Board.M_CAPTURED);
View Full Code Here

            boolean notify;
            int pos = game.board.pos(cursorX, cursorY);
            if (game.board.get(pos) == Board.NONE) {
                notify = super.doPlay();
            } else {
                Group group = new Group(game.board.maxPos());
                game.board.getGroup(pos, group);
                if (game.board.isBit(pos, Board.M_CAPTURED))
                    game.board.clearBit(group, Board.M_CAPTURED);
                else
                    game.board.setBit(group, Board.M_CAPTURED);
View Full Code Here

import junit.framework.TestCase;

public class GroupTest extends TestCase {

    public void testAdd() {
        Group g = new Group(3);
        g.add(1);
        assertEquals(1, g.size);
        assertEquals(1, g.stones[0]);
    }
View Full Code Here

        assertEquals(1, g.size);
        assertEquals(1, g.stones[0]);
    }

    public void testRemove() {
        Group g = new Group(3);
        g.add(1);
        g.add(2);
        g.add(3);
        g.remove(1);
        assertEquals(2, g.size);
        assertEquals(3, g.stones[0]);
        assertEquals(2, g.stones[1]);
        g.remove(2);
        assertEquals(1, g.size);
        g.remove(3);
        assertEquals(0, g.size);
        g.remove(5);
        assertEquals(0, g.size);
    }
View Full Code Here

        g.remove(5);
        assertEquals(0, g.size);
    }

    public void testClear() {
        Group g = new Group(3);
        g.add(1);
        g.add(2);
        g.add(3);
        g.liberties = 10;
        g.clear();
        assertEquals(0, g.size);
        assertEquals(0, g.liberties);
    }
View Full Code Here

            boolean notify;
            int pos = game.board.pos(cursorX, cursorY);
            if (game.board.get(pos) == Board.NONE) {
                notify = super.doPlay();
            } else {
                Group group = new Group(game.board.maxPos());
                game.board.getGroup(pos, group);
                if (game.board.isBit(pos, Board.M_CAPTURED))
                    game.board.clearBit(group, Board.M_CAPTURED);
                else
                    game.board.setBit(group, Board.M_CAPTURED);
View Full Code Here

TOP

Related Classes of com.tinygo.logic.Group

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.