aboutsummaryrefslogtreecommitdiff
path: root/SuperPolarityMac/Widget.cs
diff options
context:
space:
mode:
authorBen Beltran <ben@nsovocal.com>2014-02-11 01:15:19 -0600
committerBen Beltran <ben@nsovocal.com>2014-02-11 01:15:19 -0600
commitd7a43ae2d3d4702bd199fa5d8ca84c7c6e78ed36 (patch)
tree28be1c08e360ad3122042243a326f1352797d802 /SuperPolarityMac/Widget.cs
parent6fceaa7b34f4d6efc497cda51679b37e530a61aa (diff)
Consolidate with mac project.
Diffstat (limited to 'SuperPolarityMac/Widget.cs')
-rw-r--r--SuperPolarityMac/Widget.cs92
1 files changed, 0 insertions, 92 deletions
diff --git a/SuperPolarityMac/Widget.cs b/SuperPolarityMac/Widget.cs
deleted file mode 100644
index ea92cfd..0000000
--- a/SuperPolarityMac/Widget.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-
-namespace SuperPolarity
-{
- class Widget
- {
- public List<Widget> Children;
- public Dictionary<string, List<Action<float>>> Listeners;
-
- public Vector2 Position;
- public SuperPolarity Game;
-
- protected bool Active;
-
- public Widget(SuperPolarity game, Vector2 position)
- {
- Game = game;
- Position = position;
- Active = false;
- Children = new List<Widget>();
- Listeners = new Dictionary<string, List<Action<float>>>();
- }
-
- public void Activate()
- {
- Active = true;
- }
-
- public void Deactivate()
- {
- Active = false;
- }
-
- public virtual void AppendChild(Widget widget)
- {
- Children.Add(widget);
- }
-
- public virtual void Bind(string eventName, Action<float> eventListener)
- {
- List<Action<float>> newListenerList;
- List<Action<float>> listenerList;
- bool foundListeners;
-
- if (!Listeners.ContainsKey(eventName))
- {
- newListenerList = new List<Action<float>>();
- Listeners.Add(eventName, newListenerList);
- }
-
- foundListeners = Listeners.TryGetValue(eventName, out listenerList);
-
- listenerList.Add(eventListener);
- }
-
- public virtual void Unbind(string eventName, Action<float> eventListener)
- {
- // NOT YET IMPLEMENTED;
- }
-
- public virtual void Dispatch(string eventName, float value)
- {
- List<Action<float>> listenerList;
- bool foundListeners;
-
- foundListeners = Listeners.TryGetValue(eventName, out listenerList);
-
- if (!foundListeners)
- {
- return;
- }
-
- foreach (Action<float> method in listenerList)
- {
- method(value);
- }
- }
-
- public virtual void Update(GameTime gameTime)
- {
- }
-
- public virtual void Draw(SpriteBatch spriteBatch)
- {
- }
- }
-}