X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fcarfire;a=blobdiff_plain;f=CarFire%2FCarFire%2FCarFire%2FTrigger.cs;h=6d639d8f343e0c80b14f504199296cc424ec492e;hp=25cc11efa1ff0ead9f574de5231166729f1ac0a0;hb=fc34f843ea42a3496a7ff5dd04853695ba628e8b;hpb=b5eebc2087c00bb67b3a3b9ddcec4743aa7a8cdb diff --git a/CarFire/CarFire/CarFire/Trigger.cs b/CarFire/CarFire/CarFire/Trigger.cs index 25cc11e..6d639d8 100644 --- a/CarFire/CarFire/CarFire/Trigger.cs +++ b/CarFire/CarFire/CarFire/Trigger.cs @@ -17,6 +17,13 @@ namespace CarFire { #region Public Methods + /// + /// Construct a trigger entity. + /// + /// The entity identifier. + /// The position. + /// The key-value pairs. + /// The game reference. public Trigger(char identifier, Point position, Dictionary info, Game game) { mGame = game; @@ -38,7 +45,11 @@ namespace CarFire else throw new Exception("Triggers must define an event script."); } - public void Update(TimeSpan timeSpan) + /// + /// Check the trigger condition and execute the event if the + /// condition evaluates to true. + /// + public void Call() { Player player = mGame.GetPlayerAtCoordinates(mCoordinates); if (player != null) @@ -56,12 +67,22 @@ namespace CarFire } } - public void LoadContent(ContentManager contentManager) + + /// + /// Calls the trigger. + /// + /// Unused. + public virtual void Update(TimeSpan timeSpan) + { + Call(); + } + + public virtual void LoadContent(ContentManager contentManager) { // No implementation needed. } - public void Draw(SpriteBatch spriteBatch) + public virtual void Draw(SpriteBatch spriteBatch) { // No implementation needed. }