Example #1
0
 public StateControllerBase(
     IFacadeBase facade,
     PotentialStatesContainer potentialStates
     )
 {
     m_Facade    = facade;
     m_Potential = potentialStates;
 }
 public SheepIsIdle(
     IFacadeBase facade,
     SheepIsIdle.Settings settings
     ) : base(
         facade
         )
 {
 }
Example #3
0
 public SheepController(
     IFacadeBase facade,
     SheepSystemSettings settings,
     SheepModel model
     ) : base(
         facade,
         (settings == null ? null : settings.PotentialStates)
         )
 {
     m_Model = model;
 }
Example #4
0
        public SheepIsAnxious(
            IFacadeBase facade,
            SheepIsAnxious.Settings settings
            ) : base(
                facade
                )
        {
            m_Settings      = settings;
            m_Dependencies  = new SheepIsAnxious.Dependencies();
            m_CurrentFields = new SheepIsAnxious.CurrentFields();

            SheepFacade sheepFac = (facade as SheepFacade);

            if (sheepFac)
            {
                m_Dependencies.Controller = sheepFac.Controller;
                m_Dependencies.Model      = sheepFac.Model;
                m_Dependencies.Movable    = (sheepFac.Model.Targets as ITargetsMovable);
            }
        }
Example #5
0
        public void Construct()
        {
            if (m_Constructed)
            {
                return;
            }

            IFacadeBase facade = GetComponent <IFacadeBase> ();

            if (facade != null)
            {
                TargetsBase targets = facade.Targets;
                if (targets is ITargetsMovable)
                {
                    m_Targets = targets as ITargetsMovable;

                    m_Targets.MovementTarget = transform.position;
                }
            }
            m_Constructed = true;
        }
Example #6
0
        public SheepIsCalm(
            IFacadeBase facade,
            SheepIsCalm.Settings settings
            ) : base(
                facade
                )
        {
            m_Settings      = settings;
            m_Dependencies  = new SheepIsCalm.Dependencies();
            m_CurrentFields = new SheepIsCalm.CurrentFields();

            SheepFacade sheepFac = (facade as SheepFacade);

            if (sheepFac)
            {
                m_Dependencies.Controller = sheepFac.Controller;
                m_Dependencies.Model      = sheepFac.Model;
                ITargetsMovable movable = m_Dependencies.Model.Targets as ITargetsMovable;
                if (movable != null)
                {
                    movable.MovementTarget = m_Dependencies.Model.Position + Vector3.forward;
                }
            }
        }
 public override StateHandlerBase Construct(IFacadeBase facade)
 {
     return(new SheepIsIdle(facade, Settings));
 }
 public abstract StateHandlerBase Construct(IFacadeBase facade);
 public StateHandlerBase(
     IFacadeBase facade
     )
 {
     m_Facade = facade;
 }