From b3183d6f04833aa3b1e29d421c421064d88f62da Mon Sep 17 00:00:00 2001 From: "nathan@daedalus" Date: Sat, 7 Apr 2012 13:15:15 -0500 Subject: [PATCH] Making AxiosTimer inheirt from AxiosGameObject for it to be casted properly --- axios.suo | Bin 116224 -> 208384 bytes axios/AxiosEngine.cd | 123 +++++++++++++++++++++++++++++-------- axios/Axios_settings.cs | 3 +- axios/Engine/AxiosTimer.cs | 16 +++-- 4 files changed, 110 insertions(+), 32 deletions(-) diff --git a/axios.suo b/axios.suo index 3ec3f27bb0fad7d405e36eb529676a84456a3f7a..3e6dab3cc86dc11142064a87e1712046d4c9be22 100644 GIT binary patch delta 5631 zcmcJT3s_Xg702&cc43#7Ac%kn3n(vPd5GWx6xdxA5drZPi_sOXWN~5F-HQRmf>C3Q zCJ{%uO=|FwG)ZI-;_vf_rEC7F-TLO+LsH%Gf&f zOR{kbWwW9YYSyAD(+TmA>wsMK7^S%TG=Y>Jf+|WN`m(>j|3+pF%1ZH_GZ<&-eh#+R zCorZ70vl)?%&_C@0Q-Ua1;5QIdE*WWlUF=OQB3l$R4owX_8l~8K+xx3p%XOFtOiO? zm=sXKPO7ureE}6}9$`{QrFJy3{k8lOs`mcQge1PY!mV zEQ}S!cI-+^VVCrgeoM~q4hbxDTolvC=~+iwxR3r#)VwTJF6yH4oVHW-QPnR!zNhrZ z4aWVaTFwVT8xyO9NX-0;H>8CYG;L??6Sf4@3NB>$0Vk`Pm96s^{LyEf&?TQZPIKjj z-83@T(qgr{mb*krvNqMbNqv#wEcMplHY3ERUq;`1W-Pdy_E0v2) z_0}fQP+Qm5wtmu-lB|-P{QQi3lWAr~u6bf!M)5?mDI+V#RBW77GR2%Tvv@<>^@bAU z2ai!U?H#H!DyYsPS!$GuYh7z^?pV|aC7b_-Avz_i=&G@}Tw>!&TdTEcm0jtR z{6see(br70S|^wW$13h8YXrC4fnexeiU>C_)2)lK<|vi>a}&tm`N~R|SZ`XdT;5I5 z*H;5-i%6+{mb)l@vPyNu$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05MrKBr?J z12pp#IN=g;WN$MrV1ApY)7#lmXnFMv`?Za!m+mOW$kr(+#rEXhx>kougZ#G5C* zkai4{#1Ih?#P)Ok8Pk^2{8Lb;XO$|;S_I6tK5I@x>>)bkc>Hz5vGoF5ru2#Ip7s{} zF3Ib6d0O{6+eF$s2sL`S8aU1nVegpr3hOtFvwQ)Z&Ti4^?s9qD_y!UCea@10iI+7O zSzbd>h-y8@co%XXa;~j@QS`VOW4$&F8Q4FYbVy2;9Zft3d74hA+wXLXzJt=r4HzSf z9>FqH>6GT?XxW^uHlNcOBd - + @@ -20,99 +20,172 @@ - + AAQAMACAAAAAAAAEACIIBAQAIAAAAAAAAAAAAAAAACQ= Engine\AxiosGameObject.cs - - - - AAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAQ= - Engine\ComplexAxiosGameObject.cs - - - + - AEQAEAABAgAAAAAgAAAAAAAAAAAAAAAAAAAAAAgAAAA= + AEQAEAABAgAAAAAgAAQAAAAAAAAAAAAAIAAAAAgAAAA= Engine\SimpleAxiosGameObject.cs - + - AAAAAIAAAAAAAgAAAAAAAAAAAAIACAAgAAIAIAAAAAQ= + AAAAEIAAAAAAAgAAAAAAAAAAAAIACAAgAAIAIAAAAAQ= Engine\SimpleDrawableAxiosGameObject.cs - + - AARoEQCCAAACAggBACAAAgAICAAAAAAAIAAAAIIAAAQ= + AARoEQCHAAACAggBACAAAgAICAAAAAAAIAAAAIIQAAQ= Engine\AxiosGameScreen.cs - + AAQAEACAAAAAAIAAAKAAAACAAAAAAAAQAAAAACAAQAQ= Engine\AxiosTimer.cs - - + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAA= Engine\Extensions\String.cs - + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAA= Engine\Extensions\Texture2D.cs - + AAAAAAAABAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAA= Engine\UI\AxiosUIObject.cs - + - AAAAAIAAAAAAAgAgAAAABAAAAAAACAAgAAIAIAgAAAQ= + AABAAIAAAAAAAgAgAAAABAAAAAAACAAoAAIAIAgAAAQ= Engine\DrawableAxiosGameObject.cs - + AAAAgAAIQAAIAAAAACAAgAAAAAAASAAAIAAAAAgCAAQ= Engine\UI\AxiosButton.cs + + + + AAAAAAAAAgABAAQBAAAAAAAAAAAgAAAAAAAAAAAAAAA= + Engine\File\AxiosFile.cs + + + + + + + AAAAAAAAAAABAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAA= + Engine\File\AxiosIsolatedFile.cs + + + + + + + AAAAAAAAAAABAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAA= + Engine\File\AxiosRegularFile.cs + + + + + + + AAAAAAAAAAABAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAA= + Engine\File\AxiosTitleFile.cs + + + + + + + AAAAAAAIAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAA= + Engine\Structures\AxiosPoint.cs + + + + + + AAAAAAAABACAAAAEAAAUAEAAABAIAAAACACAAAAAAAQ= + Engine\Structures\AxiosRectangle.cs + + + + + + AAgAAAAAAAAAAEAAAAAAAIAAEAAAAAAAAAAAAAAAAAA= + Engine\Log\AxiosLog.cs + + + + + + IAAAAEAAAAAAAAAAgAAAAgAAAAAACAAAIIACCAACAAA= + Axios_settings.cs + + - + AAQAEACAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAQ= Engine\Interfaces\IAxiosGameObject.cs - + AAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAgAAAAAAAAAAA= Engine\Interfaces\IDrawableAxiosGameObject.cs + + + + AAAAAAAAAAABAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAA= + Engine\Interfaces\IAxiosFile.cs + + + + + + AAAAAACBgAAAAAAAAQAAAAAAAQAAAAAAAAQABAAAAAA= + Engine\Log\AxiosLog.cs + + + + + + AAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAICAAAA= + Axios_settings.cs + + \ No newline at end of file diff --git a/axios/Axios_settings.cs b/axios/Axios_settings.cs index 3ccc6c6..c291a56 100644 --- a/axios/Axios_settings.cs +++ b/axios/Axios_settings.cs @@ -56,7 +56,8 @@ * - RelativeToCamera * - Cleaning and sorting using statements * - * + * 1.0.1.2 - 4/1/2012 + * - Making AxiosTimer inheirt from AxiosGameObject for it to be casted properly * */ diff --git a/axios/Engine/AxiosTimer.cs b/axios/Engine/AxiosTimer.cs index 0af822d..d5e4302 100644 --- a/axios/Engine/AxiosTimer.cs +++ b/axios/Engine/AxiosTimer.cs @@ -10,7 +10,7 @@ namespace Axios.Engine * Source: http://www.gamedev.net/topic/473544-how-to-make-a-timer-using-xna/page__view__findpost__p__4107032 * */ - public class AxiosTimer : IAxiosGameObject + public class AxiosTimer : AxiosGameObject { TimeSpan interval = new TimeSpan(0, 0, 1); TimeSpan lastTick = new TimeSpan(); @@ -35,7 +35,7 @@ namespace Axios.Engine } - public void Update(AxiosGameScreen gameScreen, GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) + public override void Update(AxiosGameScreen gameScreen, GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) { if (_enabled) @@ -43,7 +43,11 @@ namespace Axios.Engine if (gameTime.TotalGameTime - lastTick >= interval) { if (Tick != null) + { + //EventArgs e = new EventArgs(); + Tick(this, null); + } lastTick = gameTime.TotalGameTime; } @@ -54,22 +58,22 @@ namespace Axios.Engine } } - public virtual void LoadContent(AxiosGameScreen gameScreen) + public override void LoadContent(AxiosGameScreen gameScreen) { } - public void HandleInput(AxiosGameScreen gameScreen, FarseerPhysics.SamplesFramework.InputHelper input, Microsoft.Xna.Framework.GameTime gameTime) + public override void HandleInput(AxiosGameScreen gameScreen, FarseerPhysics.SamplesFramework.InputHelper input, Microsoft.Xna.Framework.GameTime gameTime) { } - public void HandleCursor(AxiosGameScreen gameScreen, FarseerPhysics.SamplesFramework.InputHelper input) + public override void HandleCursor(AxiosGameScreen gameScreen, FarseerPhysics.SamplesFramework.InputHelper input) { } - public void UnloadContent(AxiosGameScreen gameScreen) + public override void UnloadContent(AxiosGameScreen gameScreen) { }