

The castle should send a woodcutter and a carrier to a sawmill after it is built. Add another kind of building: sawmill, and another settler: woodcutter.The constructor should return back to the castle after finishing the job. Write a method in the Castle class that generates and schedules a task which searches for a building that is underConstruction but does not have a constructor, and sends a constructor there. Modify the Building class so that the constructor settler needs to reside in a building for a time proportional to resourcesToBuild().sum() before underConstruction becomes false. Add another kind of settler: a constructor, add an underConstruction boolean field to the Building class and modify notFunctional () to account for it.(The terrain can be a field in the Scheduler class.) Add a terrain: a two-dimensional array of enum objects that decides which kinds of buildings can be built at which locations.Now, a small number of carriers should still distribute all resources needed. Make the carriers return to the warehouse they came from after making a delivery, similarly to how they return when they cannot make the delivery but in case they make the delivery to a warehouse where there is not enough carriers (e.g.Add another kind of resources, for example STONE.Write a method to add a road segment between two existing waypoints.(Select one exercise the first four exercises are simple, the first three require little work.) Due Dec 2: Modify the simulation inspired by The Settlers game settlers.jar Δ in one of the following ways.Implement the Java standard library collection interfaces Set and Map using ordered linked lists, subclassing appropriate abstract classes from the library.In union and intersect methods, use the instanceof operator to switch to a general way of performing these operations in case the argument is not of the MySetImpl class. Add an iterator (or another form of browsing the elements) to the MySet interface.For bonus points, select one of the exercises: To get the locations of warnings, compile with javac -Xlint:unchecked *.java. Remember to fix all sources of so called unchecked warnings. (Some change to the class structure might be needed.) Remove the unnecessary class casts. Due Nov 18: Modify the nested Δ implementation of sets and maps (including the interfaces) to use generic types.don’t forget to add simple demonstration tests for MySet.intersect, MyMap.union and clone() methods.implement the clone() method for MySetImpl and MyMapImpl.ex3nested.jar Δ - example using nested classes.DISCLAIMER: this example does not show the right way to implement containers or good programming practice, it is just an exercise in use and limitations of inheritance and interfaces.Due Oct 14: Self-Avoiding Walk Δ Introduction to Programming in Java: SelfAvoidingWalk.java.(do not make the class defining main public).Integrated Development Environments (Java and general):
Java jar file exercise software#
Clean code: a handbook of agile software craftsmanship by Robert C.

