Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   Universal class (https://forums.graalonline.com/forums/showthread.php?t=66855)

JustBreathe 06-23-2006 11:19 AM

Universal class
 
Perhaps it would be interesting to make a universal class, joined by every object...

Such would allow functions such as these:

PHP Code:

public function isNumeric()
  {
  if ( 
this.objectType() != "TGraalVar" )
    return 
false;

  
// Missing count .'s [ 1.2.25 != Numeric, but still passes this Numeric check]
  
for ( 0this.length(); ++ )
    if ( !(
this.substring(i,1in {"1","2","3","4","5","6","7","8","9","0","."} ))
      return 
false;

  return 
true;
  } 

Maybe name the class 'global', 'universal', or... Maybe have it based on the Object Type?

TGraalVar would join class TGraalVar... TStaticVar would join class TStaticVar?

Maybe make an init phase so that you could do something like:

PHP Code:

class TStaticVar:

function 
onClassJoined()
  {
  
join"TGraalVar" );
  } 

OR! Make it follow the Object Tree given in:
http://wiki.graal.net/index.php/Crea...F_Object_Types

Example:

GuiArrayControl would join classes:
GuiArrayControl, GuiControl, and TGraalVar

Admins 06-23-2006 11:09 PM

Joining classes means some overhead in the execution of scripts (and more network traffic since it needs to tell the clients when an object joins a class). You can let the objects join those classes manually though?

calani 06-24-2006 05:18 PM

Nice idea, but, is there really a point?

JustBreathe 06-24-2006 06:57 PM

Adding more functions to the client itself.

If they all add a class ( of set name ) to every single thing, wouldn't it be mundane to tell it joined a class that it is already aware that it would join it no matter what?

Briefly: If they joined a predefined name, it wouldn't need to tell it joined that class, because everything joins it. ( so they can consider they joined the universal class(es) without actually telling everyone about it )


All times are GMT +2. The time now is 05:30 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.