![]() |
Inheriting enums?
I am defining an enum in class 1, like this:
NPC Code: then in another class I do: NPC Code: and the chat text of NPCs of that class gets set to 0. Why is it not 1, ie. why is the enum not coming into scope by having the surrounding class joined? Edit: Same with "const" constants, actually. |
Because join and leave are dynamic functions, not done at compile time. It could be possible to expand the "import" function to allow importing of const and enums from other classes.
|
Quote:
|
Quote:
You make the class "foo.bar" and you can do stuff like PHP Code:
PHP Code:
|
Quote:
|
Quote:
|
Quote:
It's not really doing a lot though. |
Quote:
|
Quote:
|
import is a bit buggy though, every time I attempt to do something with it I encounter errors after the program structure gets more complicated.
|
Quote:
Might be interesting to add a wiki page for the npcserver/gserver updates, there is usually a lot. In the past few weeks these things were added (will work once the new npcserver is tested and uploaded everywhere): - /stats displays memory usage - calling leave() for other objects will directly let the object leave the class instead of waiting until the current script has finished execution - TDrawingPanel on serverside for image manipulation, also adds a new command maskimage(x,y,imagename,"add" or "multiply") - getimgwidth() and getimgheight() also work for jpegs etc., not just gifs and png/mng - some new commands for the mudlib which are secret right now except for the kingdoms staff |
Quote:
|
Quote:
|
| All times are GMT +2. The time now is 11:37 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.