From b1eb36d3fbc5012b07489454a7452e8488507f6a Mon Sep 17 00:00:00 2001 From: marcinzelent Date: Sun, 21 Feb 2021 14:13:49 +0100 Subject: Initial commit --- Views/View.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Views/View.cs (limited to 'Views/View.cs') diff --git a/Views/View.cs b/Views/View.cs new file mode 100644 index 0000000..5db14c9 --- /dev/null +++ b/Views/View.cs @@ -0,0 +1,24 @@ +using System; +using KukaPizza.Controllers; + +namespace KukaPizza.Views +{ + public abstract class View + { + private Controller _controller; + public void Init(Controller controller) + { + _controller = controller; + Draw(); + Interact(); + } + + protected abstract void Draw(); + protected abstract void Interact(); + + public void NavigateTo(Type view) + { + Activator.CreateInstance(view, _controller); + } + } +} \ No newline at end of file -- cgit v1.2.3