Exemplo n.º 1
0
        public void Clear()
        {
            this.treeA = null;
            this.treeB = null;
            this.name  = CollisionPair.Name.Not_Initialized;

            this.pSubject = null;
        }
Exemplo n.º 2
0
        //----------------------------------------------------------------------
        // Methods
        //----------------------------------------------------------------------
        public void set(CollisionPair.Name colPairName, GameObject pTreeRootA, GameObject pTreeRootB)
        {
            Debug.Assert(pTreeRootA != null);
            Debug.Assert(pTreeRootB != null);

            this.pTreeA = pTreeRootA;
            this.pTreeB = pTreeRootB;
            this.name   = colPairName;
        }
Exemplo n.º 3
0
        public CollisionPair()
            : base()
        {
            this.treeA = null;
            this.treeB = null;
            this.name  = CollisionPair.Name.Not_Initialized;

            this.pSubject = new CollisionSubject();
            Debug.Assert(this.pSubject != null);
        }
Exemplo n.º 4
0
        public void SetCollisionPair(CollisionPair.Name colPairName, GameObject pTreeA, GameObject pTreeB)
        {
            Debug.Assert(pTreeA != null);
            Debug.Assert(pTreeB != null);
            //Debug.Assert(this.poColSubject != null);

            this.name  = colPairName;
            this.treeA = pTreeA;
            this.treeB = pTreeB;
        }
Exemplo n.º 5
0
        public CollisionPair(CollisionPair.Name colPairName, GameObject pTreeA, GameObject pTreeB)
        {
            Debug.Assert(pTreeA != null);
            Debug.Assert(pTreeB != null);

            this.name         = colPairName;
            this.treeA        = pTreeA;
            this.treeB        = pTreeB;
            this.poColSubject = new CollisionSubjects();

            Debug.Assert(this.poColSubject != null);
        }
Exemplo n.º 6
0
        public static CollisionPair Add(CollisionPair.Name colPairName, GameObject treeA, GameObject treeB)
        {
            CollisionPairManager pMan = CollisionPairManager.PrivGetInstance();

            Debug.Assert(pMan != null);

            CollisionPair pPair = (CollisionPair)pMan.BaseAdd();

            Debug.Assert(pPair != null);

            pPair.SetCollisionPair(colPairName, treeA, treeB);
            return(pPair);
        }
Exemplo n.º 7
0
        // Factory method, create and add Collision Pair into actives
        public CollisionPair AddCollisionPair(CollisionPair.Name _name, GameObject _host, GameObject _visitor)
        {
            // get a new object
            CollisionPair ret = (CollisionPair)this.PullFromReserved();

            // set values
            ret.set(_name, _host, _visitor);

            // add to the active list
            this.Add(ret);

            return(ret);
        }
Exemplo n.º 8
0
        public static CollisionPair Find(CollisionPair.Name name)
        {
            // ensure call Create() first
            CollisionPairMan pMan = CollisionPairMan.GetInstance();

            Debug.Assert(pMan != null);

            pMan.poNodeForCompare.setName(name);

            CollisionPair pData = (CollisionPair)pMan.baseFind(pMan.poNodeForCompare);

            return(pData);
        }
        public static CollisionPair Find(CollisionPair.Name name)
        {
            CollisionPairManager pInstance = CollisionPairManager.PrivGetInstance();

            Debug.Assert(pInstance != null);

            // Compare functions only compares two Nodes

            // So:  Use the Compare Node - as a reference
            //      use in the Compare() function
            pInstance.poNodeCompare.SetName(name);

            CollisionPair pData = (CollisionPair)pInstance.BaseFind(pInstance.poNodeCompare);

            return(pData);
        }
Exemplo n.º 10
0
        public static CollisionPair Add(CollisionPair.Name colPairName, GameObject pTreeRootA, GameObject pTreeRootB)
        {
            // ensure call Create() first
            CollisionPairMan pMan = CollisionPairMan.GetInstance();

            Debug.Assert(pMan != null);

            CollisionPair pColPair = (CollisionPair)pMan.baseAdd();

            Debug.Assert(pColPair != null);

            // initialize collision pair
            pColPair.set(colPairName, pTreeRootA, pTreeRootB);

            return(pColPair);
        }
Exemplo n.º 11
0
        public static CollisionPair Find(CollisionPair.Name name)
        {
            CollisionPairManager pMan = CollisionPairManager.pActiveMan;

            Debug.Assert(pMan != null);

            // Compare functions only compares two Nodes

            // So:  Use the Compare Node - as a reference
            //      use in the Compare() function
            CollisionPairManager.poNodeCompare.SetName(name);

            CollisionPair pData = (CollisionPair)pMan.BaseFind(CollisionPairManager.poNodeCompare);

            return(pData);
        }
Exemplo n.º 12
0
        public static CollisionPair Add(CollisionPair.Name colpairName, GameObject treeRootA, GameObject treeRootB)
        {
            // Get the instance
            CollisionPairManager pInstance = CollisionPairManager.PrivGetInstance();

            Debug.Assert(pInstance != null);

            // Go to Man, get a node from reserve, add to active, return it
            CollisionPair pColPair = (CollisionPair)pInstance.BaseAdd();

            Debug.Assert(pColPair != null);

            // Initialize Image
            pColPair.Set(colpairName, treeRootA, treeRootB);

            return(pColPair);
        }
Exemplo n.º 13
0
 public void SetName(CollisionPair.Name pairName)
 {
     this.name = pairName;
 }
Exemplo n.º 14
0
 public void setName(CollisionPair.Name name)
 {
     this.name = name;
 }
Exemplo n.º 15
0
 // called by manager factory method, to set value for newly pulled object
 public void set(CollisionPair.Name _name, GameObject host, GameObject visitor)
 {
     this.name        = _name;
     this.treeHost    = host;
     this.treeVisitor = visitor;
 }
Exemplo n.º 16
0
 public void Wash()
 {
     this.treeA = null;
     this.treeB = null;
     this.name  = CollisionPair.Name.Not_Initialized;
 }
Exemplo n.º 17
0
 public void SetName(CollisionPair.Name inName)
 {
     this.name = inName;
 }