public abstract class TangibleEntity : Entity {
public Vector3 Position;
public Vector3 Velocity;
}
public abstract class ModelledEntity : TangibleEntity {
public ModelReference Model;
public float Scaling;
public bool CameraCanSeeThis(Camera camera) {
return !PhysicsSystem.RayTest(camera.Position, Position).IsObscured;
}
}
public abstract class AudibleEntity : TangibleEntity {
public SoundReference Sound;
public float SoundRadius;
public bool CameraCanHearThis(Camera camera) {
return SoundRadius > Vector3.Distance(camera.Position, Position);
}
}
Code snippet taken from "Simulating Multiple Inheritance In C#".