Game Development Reference
In-Depth Information
Figure 10-10 . Mouse-over the yellow light bulb icon in the line number area of the pane and reveal the constructor
tip
For the first final keyword that you click on, and Alt-Enter, and have NetBeans
write your CastingDirector() constructor method for, it will code the public Cast-
ingDirector(){...} structure for you, and add the first instantiation statement. As you
can see in Figure 10-11 , once you click on each of the three final keywords at the top
of your class and use the same work process, you can have NetBeans write the entire
constructor method for you. The Java code that NetBeans generates uses the Java this
keyword (so that the CastingDirector object can refer to itself) to preface each of the
three data store objects, as well as using the Java new keyword to create new instances
of ArrayList<E> and HashSet<E> should look like the following:
public CastingDirector() {
this .CURRENT_CAST = new ArrayList<>();
this .COLLIDE_CHECKLIST = new ArrayList<>();
this .REMOVED_ACTORS = new HashSet<>();
}
 
 
Search WWH ::




Custom Search