Exemple #1
0
        public void RemoveGameObj(IGameObj obj, bool asPhi, bool asShe, bool asRaderOwner, bool asEyeable, GameObjLayer layer)
        {
            if (obj == null)
            {
                throw new NullReferenceException("GameObj is null!");
            }

            if (asPhi && !(obj is IPhisicalObj))
            {
                throw new Exception("obj isn't a IPhisicalObj!");
            }
            if (!(obj is ICollideObj))
            {
                throw new Exception("obj isn't a ICollideObj!");
            }
            if (asShe && !(obj is IShelterObj))
            {
                throw new Exception("obj isn't a IShelterObj!");
            }
            if (asRaderOwner && !(obj is IRaderOwner))
            {
                throw new Exception("obj isn't a IRaderOwner!");
            }
            if (asEyeable && !(obj is IEyeableObj))
            {
                throw new Exception("obj isn't a IEyeableObj!");
            }

            SenceObjs.Remove(obj);

            if (asPhi)
            {
                phisicalObjs.Remove((IPhisicalObj)obj);
            }
            if (asShe)
            {
                tankRaderShelters.Remove((IShelterObj)obj);
            }
            if (asRaderOwner)
            {
                tankRaderOwners.Remove((IRaderOwner)obj);
            }

            if (layer == GameObjLayer.Convace)
            {
                concaveObjs.Remove((ICollideObj)obj);
            }
            else if (layer == GameObjLayer.LowBulge)
            {
                lowBulgeObjs.Remove((ICollideObj)obj);
            }
            else if (layer == GameObjLayer.HighBulge)
            {
                highBulgeObjs.Remove((ICollideObj)obj);
            }
            else if (layer == GameObjLayer.lowFlying)
            {
                lowFlyingObjs.Remove((ICollideObj)obj);
            }
            else if (layer == GameObjLayer.highFlying)
            {
                highFlyingObjs.Remove((ICollideObj)obj);
            }

            if (asEyeable)
            {
                visibleObjs.Remove((IEyeableObj)obj);
            }
        }
Exemple #2
0
        public void AddGameObj(IGameObj obj, bool asPhi, bool asShe, bool asRaderOwner, GameObjLayer layer, GetEyeableInfoHandler getEyeableInfo)
        {
            AddGameObj(obj, asPhi, asShe, asRaderOwner, layer);

            visibleObjs.Add((IEyeableObj)obj, getEyeableInfo);
        }
Exemple #3
0
        public void AddGameObj(IGameObj obj, bool asPhi, bool asShe, bool asRaderOwner, GameObjLayer layer)
        {
            if (obj == null)
            {
                throw new NullReferenceException("GameObj is null!");
            }

            if (asPhi && !(obj is IPhisicalObj))
            {
                throw new Exception("obj isn't a IPhisicalObj!");
            }
            if (!(obj is ICollideObj))
            {
                throw new Exception("obj isn't a ICollideObj!");
            }
            if (asShe && !(obj is IShelterObj))
            {
                throw new Exception("obj isn't a IShelterObj!");
            }
            if (asRaderOwner && !(obj is IRaderOwner))
            {
                throw new Exception("obj isn't a IRaderOwner!");
            }


            SenceObjs.AddLast(obj);

            if (asPhi)
            {
                phisicalObjs.AddLast((IPhisicalObj)obj);
            }
            if (asShe)
            {
                tankRaderShelters.AddLast((IShelterObj)obj);
            }
            if (asRaderOwner)
            {
                tankRaderOwners.AddLast((IRaderOwner)obj);
            }


            if (layer == GameObjLayer.Convace)
            {
                concaveObjs.AddLast((ICollideObj)obj);
            }
            else if (layer == GameObjLayer.LowBulge)
            {
                lowBulgeObjs.AddLast((ICollideObj)obj);
            }
            else if (layer == GameObjLayer.HighBulge)
            {
                highBulgeObjs.AddLast((ICollideObj)obj);
            }
            else if (layer == GameObjLayer.lowFlying)
            {
                lowFlyingObjs.AddLast((ICollideObj)obj);
            }
            else if (layer == GameObjLayer.highFlying)
            {
                highFlyingObjs.AddLast((ICollideObj)obj);
            }

            assignedID++;
            obj.ObjInfo.SetID(assignedID);

            //bool isTankObstacle = layer == GameObjLayer.HighBulge || layer == GameObjLayer.Convace || layer == GameObjLayer.LowBulge;
            //obj.ObjInfo.SetSceneInfo( new SceneCommonObjInfo( asShe, isTankObstacle ) );
        }
        public void RemoveGameObj ( IGameObj obj, bool asPhi, bool asShe, bool asRaderOwner, bool asEyeable, GameObjLayer layer )
        {
            if (obj == null)
                throw new NullReferenceException( "GameObj is null!" );

            if (asPhi && !(obj is IPhisicalObj))
                throw new Exception( "obj isn't a IPhisicalObj!" );
            if (!(obj is ICollideObj))
                throw new Exception( "obj isn't a ICollideObj!" );
            if (asShe && !(obj is IShelterObj))
                throw new Exception( "obj isn't a IShelterObj!" );
            if (asRaderOwner && !(obj is IRaderOwner))
                throw new Exception( "obj isn't a IRaderOwner!" );
            if (asEyeable && !(obj is IEyeableObj))
                throw new Exception( "obj isn't a IEyeableObj!" );

            SenceObjs.Remove( obj );

            if (asPhi)
                phisicalObjs.Remove( (IPhisicalObj)obj );
            if (asShe)
                tankRaderShelters.Remove( (IShelterObj)obj );
            if (asRaderOwner)
                tankRaderOwners.Remove( (IRaderOwner)obj );

            if (layer == GameObjLayer.Convace)
                concaveObjs.Remove( (ICollideObj)obj );
            else if (layer == GameObjLayer.LowBulge)
                lowBulgeObjs.Remove( (ICollideObj)obj );
            else if (layer == GameObjLayer.HighBulge)
                highBulgeObjs.Remove( (ICollideObj)obj );
            else if (layer == GameObjLayer.lowFlying)
                lowFlyingObjs.Remove( (ICollideObj)obj );
            else if (layer == GameObjLayer.highFlying)
                highFlyingObjs.Remove( (ICollideObj)obj );

            if (asEyeable)
            {
                visibleObjs.Remove( (IEyeableObj)obj );
            }

        }
        public void AddGameObj ( IGameObj obj, bool asPhi, bool asShe, bool asRaderOwner, GameObjLayer layer, GetEyeableInfoHandler getEyeableInfo )
        {
            AddGameObj( obj, asPhi, asShe, asRaderOwner, layer );

            visibleObjs.Add( (IEyeableObj)obj, getEyeableInfo );
        }
        public void AddGameObj ( IGameObj obj, bool asPhi, bool asShe, bool asRaderOwner, GameObjLayer layer )
        {
            if (obj == null)
                throw new NullReferenceException( "GameObj is null!" );

            if (asPhi && !(obj is IPhisicalObj))
                throw new Exception( "obj isn't a IPhisicalObj!" );
            if (!(obj is ICollideObj))
                throw new Exception( "obj isn't a ICollideObj!" );
            if (asShe && !(obj is IShelterObj))
                throw new Exception( "obj isn't a IShelterObj!" );
            if (asRaderOwner && !(obj is IRaderOwner))
                throw new Exception( "obj isn't a IRaderOwner!" );


            SenceObjs.AddLast( obj );

            if (asPhi)
                phisicalObjs.AddLast( (IPhisicalObj)obj );
            if (asShe)
                tankRaderShelters.AddLast( (IShelterObj)obj );
            if (asRaderOwner)
                tankRaderOwners.AddLast( (IRaderOwner)obj );


            if (layer == GameObjLayer.Convace)
                concaveObjs.AddLast( (ICollideObj)obj );
            else if (layer == GameObjLayer.LowBulge)
                lowBulgeObjs.AddLast( (ICollideObj)obj );
            else if (layer == GameObjLayer.HighBulge)
                highBulgeObjs.AddLast( (ICollideObj)obj );
            else if (layer == GameObjLayer.lowFlying)
                lowFlyingObjs.AddLast( (ICollideObj)obj );
            else if (layer == GameObjLayer.highFlying)
                highFlyingObjs.AddLast( (ICollideObj)obj );

            assignedID++;
            obj.ObjInfo.SetID( assignedID );

            //bool isTankObstacle = layer == GameObjLayer.HighBulge || layer == GameObjLayer.Convace || layer == GameObjLayer.LowBulge;
            //obj.ObjInfo.SetSceneInfo( new SceneCommonObjInfo( asShe, isTankObstacle ) );

        }