Package resource

Examples of resource.TraceResource


                    resource = new ColorResource();
                } else if (colorString.length > 1) {
                    resource = new ColorResource(colorString[1]);
                }
            } else if (typeString.startsWith(EnvironmentConstants.TRACE_RESOURCE)) {
                resource = new TraceResource();
            }
            localGrid[x][y] = new Cell(x, y, resource, params);
        }
        scanner.close();
        return localGrid;
View Full Code Here


    public void deleteTail(Agent tracer) {
        System.err.println("\n[World.deleteTail]");
        Cell birthCell = tracer.getBirthCell();
        System.err.println("birthCell: " + birthCell);
        TraceResource resource = (TraceResource) birthCell.getResource();
        boolean oneSegment = false;
        if (resource.getTracer().equals(tracer.toString())) {
            oneSegment = deleteTail(birthCell);
        }

        if (!oneSegment) {
            Cell deathCell = tracer.getDeathCell();
            System.err.println("deathCell: " + deathCell);
            resource = (TraceResource) deathCell.getResource();
            if (resource.getTracer().equals(tracer.toString())) {
                deleteTail(deathCell);
            }
        } else {
            System.err.println("Only one segment");
        }
View Full Code Here

            Cell cell = getUnit().move(getDnaParams().getSpecies(), downMove, rightMove, getProgenitor());
            if (oldX != cell.getX() || oldY != cell.getY()) {
                Resource resource = getUnit().getCell().getResource();
                int artisticType = resource.getType();
                if (artisticType == ResourceConstants.ARTISTIC_TRACE_RESOURCE) {
                    TraceResource traceResource = (TraceResource) resource;
                    traceResource.setColor(getInternalColor());
                    traceResource.setTracer(this.toString());
                    duplicate();
                } else if (artisticType == ResourceConstants.ARTISTIC_COLOR_RESOURCE) {
                    TraceResource traceResource = new TraceResource(this.toString());
                    traceResource.setColor(getInternalColor());
                    getUnit().getCell().setResource(traceResource);
                }
                if (getBirthCell() == null) {
                    setBirthCell(new Cell(cell.getX(), cell.getY(), cell.getResource(), null));
                    System.err.println("BIRTH CELL: (" + getBirthCell().getX() + "," + getBirthCell().getY() + ") for tracer " + this.toString());
View Full Code Here

TOP

Related Classes of resource.TraceResource

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.