Beispiel #1
0
 void Awake()
 {
     person   = this.gameObject.GetComponent <Person>();
     command  = GetComponent <Command>();
     aware    = GetComponent <Aware>();
     visitors = GameObject.Find("Game Controller").GetComponent <s_PersonControl>();
     gameplay = GameObject.Find("Game Controller").GetComponent <s_GamePlay>();
 }
Beispiel #2
0
 void Awake()
 {
     person   = this.gameObject.GetComponent <Person>();
     route    = GameObject.Find("Game Controller").GetComponent <s_RouteControl>();
     command  = GetComponent <Command>();
     aware    = GetComponent <Aware>();
     visitors = GameObject.Find("Game Controller").GetComponent <s_PersonControl>();
     clicker  = GameObject.Find("Game Controller").GetComponent <s_Clicker>();
 }
Beispiel #3
0
    void Awake()
    {
        //aiguard = transform.parent.GetComponent<AIGuard>();

        command = transform.parent.GetComponent<Command>();
        aware = this.transform.parent.GetComponent<Aware>();
        aware.DetectionRange = this.gameObject.GetComponent<SphereCollider>();
        me = this.gameObject.transform.parent.gameObject;
    }
Beispiel #4
0
    void Awake()
    {
        //aiguard = transform.parent.GetComponent<AIGuard>();

        command = transform.parent.GetComponent<Command>();
        aware = this.transform.parent.GetComponent<Aware>();
        aware.DetectionRange = this.gameObject.GetComponent<SphereCollider>();
        me = this.gameObject.transform.parent.gameObject;
    }
Beispiel #5
0
    //public Transform head;

    void Awake()
    {
        steerfortarget = gameObject.GetComponent <SteerForTarget>();
        vehicle        = this.gameObject.GetComponent <AutonomousVehicle>();
        person         = this.gameObject.GetComponent <Person>();
        aware          = this.gameObject.GetComponent <Aware>();
        personControl  = GameObject.Find("Game Controller").GetComponent <s_PersonControl>();
        me             = this.gameObject;
        sightdetect    = this.gameObject.GetComponentInChildren <SightDetect>();
        clicker        = GameObject.Find("Game Controller").GetComponent <s_Clicker>();
    }
Beispiel #6
0
    public void LockCombat(GameObject enemy)
    {
        Person  enemyPerson  = enemy.GetComponent <Person>();
        Command enemyCommand = enemy.GetComponent <Command>();
        Aware   enemyAware   = enemy.GetComponent <Aware>();


        Stop();
        person.tech.state = Tech.State.combat;



        enemyCommand.Stop();
        enemyPerson.tech.state = Tech.State.combat;

        bool existsDetectedList, existsHiddenList = false;

        //check if DETECTED list has skabengas, if it does, check it for DETECTED
        if (enemyAware.DetectedList.Count > 0)
        {
            existsDetectedList = enemyAware.DetectedList.Find(element => element == me);
        }
        else
        {
            existsDetectedList = false;
        }

        //check if HIDDEN list has skabengas, if it does, check it for DETECTED
        if (enemyAware.HiddenList.Count > 0)
        {
            existsHiddenList = enemyAware.HiddenList.Find(element => element == me);
        }
        else
        {
            existsHiddenList = false;
        }

        //if DETECTED is not found (is new) then add it to the appropriate list
        if (existsDetectedList == false && existsHiddenList == false)
        {
            enemyAware.DetectedList.Add(me);
        }

        if (existsDetectedList == false && existsHiddenList == true)
        {
            enemyAware.DetectedList.Add(me);
            enemyAware.HiddenList.Remove(me);
        }

        enemyAware.UserTarget = me;


        enemy.transform.LookAt(this.transform.position);
    }
Beispiel #7
0
        public void BuildChecksConcreteTypeAndNotRequestedType()
        {
            BuilderAwareStrategy strategy = new BuilderAwareStrategy();
            MockBuilderContext   context  = new MockBuilderContext();
            Aware obj = new Aware();

            context.Strategies.Add(strategy);

            context.ExecuteBuildUp(typeof(Aware), obj);

            Assert.IsTrue(obj.OnBuiltUp__Called);
            Assert.IsFalse(obj.OnTearingDown__Called);
        }
        public void BuildChecksConcreteTypeAndNotRequestedType()
        {
            var strategy = new BuilderAwareStrategy();
            var context  = new MockBuilderContext();
            var obj      = new Aware();

            context.Strategies.Add(strategy);

            context.ExecuteBuildUp(new NamedTypeBuildKey <Aware>(), obj);

            Assert.True(obj.OnBuiltUpWasCalled);
            Assert.False(obj.OnTearingDownWasCalled);
        }
        public void BuildChecksConcreteTypeAndNotRequestedType()
        {
            var strategy = new BuilderAwareStrategy();
            var context = new MockBuilderContext();
            var obj = new Aware();

            context.Strategies.Add(strategy);

            context.ExecuteBuildUp(new NamedTypeBuildKey<Aware>(), obj);

            Assert.IsTrue(obj.OnBuiltUp__Called);
            Assert.IsFalse(obj.OnTearingDown__Called);
        }
        public void TearDownCallsClassWithInterface()
        {
            var strategy = new BuilderAwareStrategy();
            var context = new MockBuilderContext();
            var obj = new Aware();

            context.Strategies.Add(strategy);

            context.ExecuteTearDown(obj);

            Assert.IsFalse(obj.OnBuiltUpWasCalled);
            Assert.IsTrue(obj.OnTearingDownWasCalled);
        }
        public void TearDownCallsClassWithInterface()
        {
            var strategy = new BuilderAwareStrategy();
            var context  = new MockBuilderContext();
            var obj      = new Aware();

            context.Strategies.Add(strategy);

            context.ExecuteTearDown(obj);

            Assert.False(obj.OnBuiltUpWasCalled);
            Assert.True(obj.OnTearingDownWasCalled);
        }
Beispiel #12
0
        public void TearDownCallsClassWithInterface()
        {
            BuilderAwareStrategy strategy = new BuilderAwareStrategy();
            MockBuilderContext   context  = new MockBuilderContext();
            Aware obj = new Aware();

            context.Strategies.Add(strategy);

            context.HeadOfChain.TearDown(context, obj);

            Assert.False(obj.OnBuiltUp__Called);
            Assert.True(obj.OnTearingDown__Called);
        }
Beispiel #13
0
        public void BuildChecksConcreteTypeAndNotRequestedType()
        {
            BuilderAwareStrategy strategy = new BuilderAwareStrategy();
            MockBuilderContext   context  = new MockBuilderContext();
            Aware obj = new Aware();

            context.Strategies.Add(strategy);

            context.HeadOfChain.BuildUp(context, typeof(Ignorant), obj);

            Assert.True(obj.OnBuiltUp__Called);
            Assert.False(obj.OnTearingDown__Called);
        }
        public void BuildCallsClassWithInterface()
        {
            var strategy = new BuilderAwareStrategy();
            var context = new MockBuilderContext();
            var obj = new Aware();

            context.Strategies.Add(strategy);

            context.ExecuteBuildUp(new NamedTypeBuildKey<Aware>(), obj);

            Assert.IsTrue(obj.OnBuiltUp__Called);
            Assert.IsFalse(obj.OnTearingDown__Called);
            Assert.AreEqual(new NamedTypeBuildKey<Aware>(), obj.OnBuiltUp_BuildKey);
        }
Beispiel #15
0
        public void BuildCallsClassWithInterface()
        {
            BuilderAwareStrategy strategy = new BuilderAwareStrategy();
            MockBuilderContext   context  = new MockBuilderContext();
            Aware obj = new Aware();

            context.Strategies.Add(strategy);

            context.HeadOfChain.BuildUp(context, typeof(Aware), obj);

            Assert.True(obj.OnBuiltUp__Called);
            Assert.False(obj.OnTearingDown__Called);
            Assert.Equal <object>(typeof(Aware), obj.OnBuiltUp_BuildKey);
        }
Beispiel #16
0
        public void BuildCallsClassWithInterface()
        {
            BuilderAwareStrategy strategy = new BuilderAwareStrategy();
            MockBuilderContext   context  = new MockBuilderContext();
            Aware obj = new Aware();

            context.Strategies.Add(strategy);

            context.ExecuteBuildUp(typeof(Aware), obj);

            Assert.IsTrue(obj.OnBuiltUp__Called);
            Assert.IsFalse(obj.OnTearingDown__Called);
            Assert.AreEqual(typeof(Aware), obj.OnBuiltUp_BuildKey);
        }
        public void BuildCallsClassWithInterface()
        {
            var strategy = new BuilderAwareStrategy();
            var context  = new MockBuilderContext();
            var obj      = new Aware();

            context.Strategies.Add(strategy);

            context.ExecuteBuildUp(new NamedTypeBuildKey <Aware>(), obj);

            Assert.True(obj.OnBuiltUpWasCalled);
            Assert.False(obj.OnTearingDownWasCalled);
            Assert.Equal(new NamedTypeBuildKey <Aware>(), obj.OnBuiltUpBuildKey);
        }
Beispiel #18
0
 //public Transform head;
 void Awake()
 {
     steerfortarget = gameObject.GetComponent<SteerForTarget>();
     vehicle = this.gameObject.GetComponent<AutonomousVehicle>();
     person = this.gameObject.GetComponent<Person>();
     aware = this.gameObject.GetComponent<Aware>();
     personControl = GameObject.Find("Game Controller").GetComponent<s_PersonControl>();
     me = this.gameObject;
     sightdetect = this.gameObject.GetComponentInChildren<SightDetect>();
     clicker = GameObject.Find("Game Controller").GetComponent<s_Clicker>();
 }
Beispiel #19
0
 void Awake()
 {
     person = this.gameObject.GetComponent<Person>();
     command = GetComponent<Command>();
     aware = GetComponent<Aware>();
     visitors = GameObject.Find("Game Controller").GetComponent<s_PersonControl>();
     gameplay = GameObject.Find("Game Controller").GetComponent<s_GamePlay>();
 }
Beispiel #20
0
 void Awake()
 {
     person = this.gameObject.GetComponent<Person>();
     route = GameObject.Find("Game Controller").GetComponent<s_RouteControl>();
     command = GetComponent<Command>();
     aware = GetComponent<Aware>();
     visitors = GameObject.Find("Game Controller").GetComponent<s_PersonControl>();
     clicker = GameObject.Find("Game Controller").GetComponent<s_Clicker>();
 }