ControllerRandomize.h

00001 // ----------------------------------------------------------------------------
00002 //
00003 // tagGame - Example code from the book:
00004 //
00005 //           Artficial Intelligence for Computer Games: An Introduction
00006 //           by John David Funge
00007 //
00008 //           www.ai4games.org
00009 //
00010 // Source code distributed under the Copyright (c) 2003-2007, John David Funge
00011 // Original author: John David Funge (www.jfunge.com)
00012 //
00013 // Licensed under the Academic Free License version 3.0 
00014 // (for details see LICENSE.txt in this directory).
00015 //
00016 // ----------------------------------------------------------------------------
00017 
00018 #ifndef TG_CONTROLLERRANDOMIZE_H
00019 #define TG_CONTROLLERRANDOMIZE_H
00020 
00021 #include "Controller.h"
00022 #include "Perception.h"
00023 
00024 namespace tagGame
00025 {
00028    class ControllerRandomize : public Controller
00029    {
00030    public:
00031       ControllerRandomize(PerceptionPtr perception,
00032                             ControllerPtr controller,
00033                             PerceptReal distance,
00034                             Real near,
00035                             Real far);
00036       virtual ~ControllerRandomize();
00037 
00038       inline ControllerPtr getController() const;
00039       inline PerceptReal getDistance() const;
00040       inline Real getNearDistance() const;
00041       inline Real getFarDistance() const;
00042 
00043       inline void setController(ControllerPtr controller);
00044       inline void setDistance(PerceptReal const distance);
00045       inline void setNearDistance(Real const nearDistance);
00046       inline void setFarDistance(Real const farDistance);
00047 
00048       virtual void calcAction();
00049 
00050    protected:
00051       ControllerPtr controller;
00052       PerceptReal distance;
00053       Real nearDistance;
00054       Real farDistance;
00055 
00056    private:
00057    };
00058 
00059    ControllerPtr ControllerRandomize::getController() const
00060    {
00061       return controller;
00062    }
00063 
00064    PerceptReal ControllerRandomize::getDistance() const
00065    {
00066       return distance;
00067    }
00068 
00069    Real ControllerRandomize::getNearDistance() const
00070    {
00071       return nearDistance;
00072    }
00073 
00074    Real ControllerRandomize::getFarDistance() const
00075    {
00076       return farDistance;
00077    }
00078 
00079    void ControllerRandomize::setController(ControllerPtr controller)
00080    {
00081       this->controller = controller;
00082    }
00083 
00084    void ControllerRandomize::setDistance(PerceptReal const distance)
00085    {
00086       this->distance = distance;
00087    }
00088 
00089    void ControllerRandomize::setNearDistance(Real const nearDistance)
00090    {
00091       this->nearDistance = nearDistance;
00092    }
00093 
00094    void ControllerRandomize::setFarDistance(Real const farDistance)
00095    {
00096       this->farDistance = farDistance;
00097    }
00098 }
00099 
00100 #endif

Generated on Sat Mar 31 22:30:54 2007 for tagGame by  doxygen 1.5.1