Yet another Resource Collecting Program - Printable Version +- Colobot Forum - International Colobot Community (https://colobot.info/forum) +-- Forum: [Archive] New forum (2015-2019) (https://colobot.info/forum/forumdisplay.php?fid=76) +--- Forum: Colobot: Gold Edition Basics (https://colobot.info/forum/forumdisplay.php?fid=58) +---- Forum: Workshop (https://colobot.info/forum/forumdisplay.php?fid=60) +---- Thread: Yet another Resource Collecting Program (/showthread.php?tid=799) |
Yet another Resource Collecting Program - blaze - 05-20-2016 I decided to play around with classes and the result is here. It's very basic program but may be a good start for someone who wants to extend it. Too bad there's no inheritance in CBot. :) Program that uses this class looks like that: [attachment=211] Load this class on the very first Grabber you've created and before any program that uses it. Not recommended for Winged Grabbers. Optimal for Legged Grabbers and Free Game mode. To suppress the messages just change bool verbose = true; to false. PHP Code: // Resources RE: Yet another Resource Collecting Program - Simbax - 05-20-2016 I like the OOPish way in which you wrote your program! About inheritance, take a look at this: https://github.com/colobot/colobot/issues/540 RE: Yet another Resource Collecting Program - blaze - 05-20-2016 (05-20-2016, 12:00 PM)Simbax Wrote: About inheritance, take a look at thisCool. I never expected this to be implemented so soon. |