X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=CarFire%2FCarFire%2FCarFire%2FTrigger.cs;h=6d639d8f343e0c80b14f504199296cc424ec492e;hb=e9d15e51944eb945665e7f955184c484a3df8552;hp=25cc11efa1ff0ead9f574de5231166729f1ac0a0;hpb=d167160264cd2c33de81a71039eddbb959c40bb2;p=chaz%2Fcarfire 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. }