Original Post
🔒 Locked
interface keyword
Advertisement
A interface is like a set of rules for an object. All objects that can go into my 3D Engine Object Manager must implement my BasicObject interface.
In the interface I define only a simple thing, that all objects must have a render function. Without that, they are not allowed in my manager class. So all objects is based on this interface.
This is C# code:
public interface IBasicObject
{
void Render();
}
If the objects don''t have a render function and implements the interface, the compilation will fail.
In the interface I define only a simple thing, that all objects must have a render function. Without that, they are not allowed in my manager class. So all objects is based on this interface.
This is C# code:
public interface IBasicObject
{
void Render();
}
If the objects don''t have a render function and implements the interface, the compilation will fail.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement