In other words I get {b,b,b} I want 3. I am trying to replicate Conway's Game of Life and I want the cell to return the number of neighboring cells. Right now all it does is find out if there are object near it and if there are it stores them in an imaginary box how do you get it to convert the number of objects in that box to an integer.
edit: I've found out it returns as lists, got it so the compiler didn't notice any errors, but when I run it i get this.
java.lang.ClassCastException: java.util.ArrayList cannot be cast to Cell
at Cell.lookForCells(Cell.java:33)
at Cell.act(Cell.java:24)
at greenfoot.core.Simulation.actActor(Simulation.java:507)
at greenfoot.core.Simulation.runOneLoop(Simulation.java:470)
at greenfoot.core.Simulation.runContent(Simulation.java:204)
at greenfoot.core.Simulation.run(Simulation.java:194)