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

27 lines
2.0 KiB
Plaintext
Executable File

#BlueJ class context
comment0.params=randomAge\ field\ location
comment0.target=Fox(boolean,\ Field,\ Location)
comment0.text=\n\ Create\ a\ fox.\ A\ fox\ can\ be\ created\ as\ a\ new\ born\ (age\ zero\n\ and\ not\ hungry)\ or\ with\ a\ random\ age\ and\ food\ level.\n\ \n\ @param\ randomAge\ If\ true,\ the\ fox\ will\ have\ random\ age\ and\ hunger\ level.\n\ @param\ field\ The\ field\ currently\ occupied.\n\ @param\ location\ The\ location\ within\ the\ field.\n
comment1.params=newFoxes
comment1.target=void\ act(java.util.List)
comment1.text=\n\ This\ is\ what\ the\ fox\ does\ most\ of\ the\ time\:\ it\ hunts\ for\n\ rabbits.\ In\ the\ process,\ it\ might\ breed,\ die\ of\ hunger,\n\ or\ die\ of\ old\ age.\n\ @param\ field\ The\ field\ currently\ occupied.\n\ @param\ newFoxes\ A\ list\ to\ return\ newly\ born\ foxes.\n
comment2.params=
comment2.target=void\ incrementAge()
comment2.text=\n\ Increase\ the\ age.\ This\ could\ result\ in\ the\ fox's\ death.\n
comment3.params=
comment3.target=void\ incrementHunger()
comment3.text=\n\ Make\ this\ fox\ more\ hungry.\ This\ could\ result\ in\ the\ fox's\ death.\n
comment4.params=
comment4.target=Location\ findFood()
comment4.text=\n\ Look\ for\ rabbits\ adjacent\ to\ the\ current\ location.\n\ Only\ the\ first\ live\ rabbit\ is\ eaten.\n\ @return\ Where\ food\ was\ found,\ or\ null\ if\ it\ wasn't.\n
comment5.params=newFoxes
comment5.target=void\ giveBirth(java.util.List)
comment5.text=\n\ Check\ whether\ or\ not\ this\ fox\ is\ to\ give\ birth\ at\ this\ step.\n\ New\ births\ will\ be\ made\ into\ free\ adjacent\ locations.\n\ @param\ newFoxes\ A\ list\ to\ return\ newly\ born\ foxes.\n
comment6.params=
comment6.target=int\ breed()
comment6.text=\n\ Generate\ a\ number\ representing\ the\ number\ of\ births,\n\ if\ it\ can\ breed.\n\ @return\ The\ number\ of\ births\ (may\ be\ zero).\n
comment7.params=
comment7.target=boolean\ canBreed()
comment7.text=\n\ A\ fox\ can\ breed\ if\ it\ has\ reached\ the\ breeding\ age.\n
numComments=8