Calling a method from static class which also inherits from a non static class
Calling a method from static class which also inherits from a non static class
$codegif in chat$codegif in chat$codegif in chat$codegif in chatcs, new line, code, new line, triple backticksWindow is not static, so no class that inherits it can be staticWindow class?staticstatic class LockscreenWindow : Window
{
public override void DrawWindow()
{
Console.WriteLine("hi");
}
}class Window
{
public virtual void DrawWindow()
{
}
}LockScreenWindow$codeusing System;
class WindowManager
{
public enum WindowName
{
Lockscreen,
Homescreen
}
public void SwitchWindow(WindowName _wName)
{
if(_wName == WindowName.Lockscreen)
{
LockscreenWindow.DrawWindow();
}
}
}class Window
{
public virtual void DrawWindow()
{
}
}