FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Error: Class 'MyClass' must inherit from 'MVM'

 
Post new topic   Reply to topic     Forum Index -> Monster
View previous topic :: View next topic  
Author Message
3-S-E



Joined: 16 Jun 2008
Posts: 54

PostPosted: Sun Apr 05, 2009 8:54 am    Post subject: Error: Class 'MyClass' must inherit from 'MVM' Reply with quote

Hi,

as written in the subject, every self made class in a mn-script must inherit from MVM, like

Code:

class Goblin : mvm;

import io;

print(){
   writeln("Hello, me is Go... Goblin...!");
}



main(){
Goblin littleGoblin;

littleGoblin = new Goblin;

littleGoblin.print();
}


Is that the common-way of using a class, or did I do something wrong?

Edit: When using Goblin as an import in an another file, lets say

Code:

import Goblin;

Goblin littleGoblin;

littleGoblin = new Goblin;

littleGoblin.print();



my Goblin-class doesn't need to inherit from mvm anymore!
Why is that so?

Cu!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Monster All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group