Files
G4G0-1/Semester 1/Programming 1/Java/examples/projects/chapter12/foxes-and-rabbits-v2/Field.ctxt
2024-01-15 20:14:10 +00:00

42 lines
3.6 KiB
Plaintext
Executable File

#BlueJ class context
comment0.params=depth\ width
comment0.target=Field(int,\ int)
comment0.text=\n\ Represent\ a\ field\ of\ the\ given\ dimensions.\n\ @param\ depth\ The\ depth\ of\ the\ field.\n\ @param\ width\ The\ width\ of\ the\ field.\n
comment1.params=
comment1.target=void\ clear()
comment1.text=\n\ Empty\ the\ field.\n
comment10.params=location
comment10.target=java.util.List\ adjacentLocations(Location)
comment10.text=\n\ Return\ a\ shuffled\ list\ of\ locations\ adjacent\ to\ the\ given\ one.\n\ The\ list\ will\ not\ include\ the\ location\ itself.\n\ All\ locations\ will\ lie\ within\ the\ grid.\n\ @param\ location\ The\ location\ from\ which\ to\ generate\ adjacencies.\n\ @return\ A\ list\ of\ locations\ adjacent\ to\ that\ given.\n
comment11.params=
comment11.target=int\ getDepth()
comment11.text=\n\ Return\ the\ depth\ of\ the\ field.\n\ @return\ The\ depth\ of\ the\ field.\n
comment12.params=
comment12.target=int\ getWidth()
comment12.text=\n\ Return\ the\ width\ of\ the\ field.\n\ @return\ The\ width\ of\ the\ field.\n
comment2.params=location
comment2.target=void\ clear(Location)
comment2.text=\n\ Clear\ the\ given\ location.\n\ @param\ location\ The\ location\ to\ clear.\n
comment3.params=animal\ row\ col
comment3.target=void\ place(java.lang.Object,\ int,\ int)
comment3.text=\n\ Place\ an\ animal\ at\ the\ given\ location.\n\ If\ there\ is\ already\ an\ animal\ at\ the\ location\ it\ will\n\ be\ lost.\n\ @param\ animal\ The\ animal\ to\ be\ placed.\n\ @param\ row\ Row\ coordinate\ of\ the\ location.\n\ @param\ col\ Column\ coordinate\ of\ the\ location.\n
comment4.params=animal\ location
comment4.target=void\ place(java.lang.Object,\ Location)
comment4.text=\n\ Place\ an\ animal\ at\ the\ given\ location.\n\ If\ there\ is\ already\ an\ animal\ at\ the\ location\ it\ will\n\ be\ lost.\n\ @param\ animal\ The\ animal\ to\ be\ placed.\n\ @param\ location\ Where\ to\ place\ the\ animal.\n
comment5.params=location
comment5.target=java.lang.Object\ getObjectAt(Location)
comment5.text=\n\ Return\ the\ animal\ at\ the\ given\ location,\ if\ any.\n\ @param\ location\ Where\ in\ the\ field.\n\ @return\ The\ animal\ at\ the\ given\ location,\ or\ null\ if\ there\ is\ none.\n
comment6.params=row\ col
comment6.target=java.lang.Object\ getObjectAt(int,\ int)
comment6.text=\n\ Return\ the\ animal\ at\ the\ given\ location,\ if\ any.\n\ @param\ row\ The\ desired\ row.\n\ @param\ col\ The\ desired\ column.\n\ @return\ The\ animal\ at\ the\ given\ location,\ or\ null\ if\ there\ is\ none.\n
comment7.params=location
comment7.target=Location\ randomAdjacentLocation(Location)
comment7.text=\n\ Generate\ a\ random\ location\ that\ is\ adjacent\ to\ the\n\ given\ location,\ or\ is\ the\ same\ location.\n\ The\ returned\ location\ will\ be\ within\ the\ valid\ bounds\n\ of\ the\ field.\n\ @param\ location\ The\ location\ from\ which\ to\ generate\ an\ adjacency.\n\ @return\ A\ valid\ location\ within\ the\ grid\ area.\n
comment8.params=location
comment8.target=java.util.List\ getFreeAdjacentLocations(Location)
comment8.text=\n\ Get\ a\ shuffled\ list\ of\ the\ free\ adjacent\ locations.\n\ @param\ location\ Get\ locations\ adjacent\ to\ this.\n\ @return\ A\ list\ of\ free\ adjacent\ locations.\n
comment9.params=location
comment9.target=Location\ freeAdjacentLocation(Location)
comment9.text=\n\ Try\ to\ find\ a\ free\ location\ that\ is\ adjacent\ to\ the\n\ given\ location.\ If\ there\ is\ none,\ return\ null.\n\ The\ returned\ location\ will\ be\ within\ the\ valid\ bounds\n\ of\ the\ field.\n\ @param\ location\ The\ location\ from\ which\ to\ generate\ an\ adjacency.\n\ @return\ A\ valid\ location\ within\ the\ grid\ area.\n
numComments=13