Colobot Forum - International Colobot Community
Access to Outside Class Definition - 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: General (https://colobot.info/forum/forumdisplay.php?fid=59)
+---- Thread: Access to Outside Class Definition (/showthread.php?tid=944)



Access to Outside Class Definition - kakhao - 08-31-2017

Can I access to public class that is defined in another file as public class?
To be more clear, suppose we're producing a bot - factory(somebotcategory, somebotcodefile).
If we want to get remote control to this bot, we need some public class with static member, that is ok, like in exercises.
But when we are working on code, there is no another bot code loaded, therefore compiler gives error.
Is there any way to get class definition from another file visible? I mean something like #include <someheader.h>.


RE: Access to Outside Class Definition - tomaszkax86 - 08-31-2017

There is no include-like functionality. You just need to load a program with your class definition to some robot. Classes are public and available to other robots. If it's for exercises, you can simply load it to an additional program slot.


RE: Access to Outside Class Definition - kakhao - 08-31-2017

It is for battle code, there is no other bot at the beginning.


RE: Access to Outside Class Definition - kakhao - 09-02-2017

I wonder, what if I create a bot code with public class element and factory few bots with this code? That is naming conflict. But logically we should suppose that codes of the bots are just definitions, not instances and should be precompiled before start except factory method, that ruins all the logic. It allows runtime coding, therefore there is no way to precompile all code. Seems there is something like code interpreter not compiler.
Maybe communication via public classes is bad idea?