示例#1
0
        public static void Initialize()
        {
            blueprintsCollection = new Array[7] {
                Blueprints.SimpleX1.blueprint, Blueprints.SimpleX2.blueprint, Blueprints.SimpleX3.blueprint,
                Blueprints.Rectangle.blueprint, Blueprints.Building.blueprint, Blueprints.Chair.blueprint, Blueprints.Human.blueprint
            };

            // SimpleX1; SimpleX2; SimpleX3; Rectangle; Human; Building; Chair; //
            bodiesCollection = new Array[2] {
                Blueprints.SimpleX1.blueprint, Blueprints.SimpleX2.blueprint
            };
            //currentBlueprints = new Array[5] { Blueprints.SimpleX2.blueprint, Blueprints.SimpleX1.blueprint, Blueprints.Rectangle.blueprint, Blueprints.Rectangle.blueprint, Blueprints.Rectangle.blueprint };
            GenerateBodies(bodiesCollection);

            wallForce    = new WallForce(9999, 9999);
            gravityForce = new GravityForce();
            dragParticle = new DragParticle();
            lockParticle = new LockParticle();
            pushParticle = new PushParticleGroup();
            panAndZoom   = new PanAndZoom();

            // automatic grouping of service elements
            IList <Object> groupElems = new List <Object>();

            groupElems.Add(wallForce);
            groupElems.Add(gravityForce);
            groupElems.Add(dragParticle);
            groupElems.Add(lockParticle);
            groupElems.Add(pushParticle);
            groupElems.Add(panAndZoom);

            foreach (Object elem in groupElems)
            {
                if (elem is IEnvironmentForce)
                {
                    world.environmentForces.Add(elem as IEnvironmentForce);
                }
                if (elem is IService)
                {
                    interactionServices.Add(elem as IService);
                }
                if (elem is MouseService)
                {
                    mouseServices.Add(elem as MouseService);
                }
            }
        }
示例#2
0
        public static void Initialize()
        {
            blueprintsCollection = new Array[7] {
                Blueprints.SimpleX1.blueprint, Blueprints.SimpleX2.blueprint, Blueprints.SimpleX3.blueprint,
                Blueprints.Rectangle.blueprint, Blueprints.Building.blueprint, Blueprints.Chair.blueprint, Blueprints.Human.blueprint
            };

            // SimpleX1; SimpleX2; SimpleX3; Rectangle; Human; Building; Chair; //
            bodiesCollection = new Array[2] { Blueprints.SimpleX1.blueprint, Blueprints.SimpleX2.blueprint };
            //currentBlueprints = new Array[5] { Blueprints.SimpleX2.blueprint, Blueprints.SimpleX1.blueprint, Blueprints.Rectangle.blueprint, Blueprints.Rectangle.blueprint, Blueprints.Rectangle.blueprint };
            GenerateBodies(bodiesCollection);

            wallForce = new WallForce(9999, 9999);
            gravityForce = new GravityForce();
            dragParticle = new DragParticle();
            lockParticle = new LockParticle();
            pushParticle = new PushParticleGroup();
            panAndZoom = new PanAndZoom();

            // automatic grouping of service elements
            IList<Object> groupElems = new List<Object>();
            groupElems.Add(wallForce);
            groupElems.Add(gravityForce);
            groupElems.Add(dragParticle);
            groupElems.Add(lockParticle);
            groupElems.Add(pushParticle);
            groupElems.Add(panAndZoom);

            foreach (Object elem in groupElems)
            {
                if (elem is IEnvironmentForce)
                    world.environmentForces.Add(elem as IEnvironmentForce);
                if (elem is IService)
                    interactionServices.Add(elem as IService);
                if (elem is MouseService)
                    mouseServices.Add(elem as MouseService);
            }
        }