public DriverInformation(CubeSet set, string appId) { AppMgrId = appId; Cube[] cubes = set.toArray (); Devices = new string[cubes.Length]; int i = 0; foreach (Cube c in cubes) { Devices [i++] = c.UniqueId; } //TODO_LATER: get the protocol version from a file! Type = "SifteoCubes"; //TODO_LATER: find a way to create a unique ID (using the mac address for instance?) Id = "myUniqueIdThatIsNotARealOneYet"; ProtocolVersion = "0.3"; Capacities = new string[5] { "show_color", "show_text", "show_picture", "show_fade", "report_events" }; ScreenSize = new int[2] { 128, 128 }; }
public void SetupAppManager(CubeSet cSet, string appID) { _setOfCube = cSet; _availableCubes = cSet; _appID = appID; _defaultApp.SetupDefaultApp (); Log.Debug ("SetupAppManager() over"); }
internal AppManagerImpl() { _defaultApp = new DefaultApp (); _setOfCube = null; }
public static void Install(CubeSet cs, Installation installation) { foreach (Cube c in cs.toArray()) { installation (c); } }
//Init public GameShuffleController(ThreeCardMonte app, CubeSet cubeSet) { Log.Debug (classname + " Init"); mApp = app; cubes = cubeSet; }
public void StartExecution(CubeSet cubes, Dispatcher uiDispatcher, SoundSet sounds) { Cubes = cubes; Sounds = sounds; _uiDispatcher = uiDispatcher; StartRunning(); }
public Selection(KYMA_SIFTEO kym, List <CubeWrapper> wrapper, CubeSet cubeset) { Selection_kyma1 = kym; mWrappers1 = wrapper; cubeset1 = cubeset; }
public void AssociateCubes(CubeSet cubes) { CubeSet = cubes; }
/*public static CubeNode createCubeNode(TextureStore textureStore, PhysicsController physicsController, CubeDescription cubeDescription, Vector2 cubeSize) * { * PhysicsGameObject pgo = new PhysicsGameObject(physicsController.physicsSimulator, cubeSize.X, cubeSize.Y, false); * * * return createCubeNode(textureStore, physicsController, cubeDescription, cubeSize, pgo); * }*/ public static CubeNode createCubeNode(TextureStore textureStore, PhysicsController physicsController, CubeDescription cubeDescription, Vector2 cubeSize, CubeSet parent) { PhysicsGameObject pgo = new PhysicsGameObject(physicsController.physicsSimulator, cubeSize.X, cubeSize.Y, false); pgo.ID = parent.ID; //physicsController.deregisterPhysicsGameObject(pgo); //pgo.textures.Clear(); List <Texture2D> defaultTextureList = new List <Texture2D>(); CubeNode ret; //public enum CubeType { UnknownCube, PlainCube, RocketCube, ShieldCube, HeavyCube }; if (cubeDescription.type == CubeType.UnknownCube) { ret = new UnknownCube(); defaultTextureList = textureStore.unknownTextures; pgo.boxBody.Mass = 0.05f; } else if (cubeDescription.type == CubeType.ChainCube) { ret = new ChainCube(); //todo TEXTURE pgo = new ChainPhysicsGameObject(physicsController.physicsSimulator); defaultTextureList = textureStore.plainTextures; pgo.getTextureSet("Default").scale.X *= 2; pgo.getTextureSet("Default").scale.Y *= 2; //ret.visualOnly = true; pgo.boxGeom.CollisionGroup = 13; } else if (cubeDescription.type == CubeType.PlainCube) { ret = new PlainCube(); defaultTextureList = textureStore.plainTextures; pgo.boxBody.Mass = 1f; } else if (cubeDescription.type == CubeType.DamageCube) { ret = new DamageCube(); defaultTextureList = textureStore.spike; } else if (cubeDescription.type == CubeType.RocketCube) { ret = new RocketCube(cubeDescription.dir); defaultTextureList = textureStore.rocketTextures; ((RocketCube)ret).activationCountdown = cubeDescription.value; foreach (Texture2D tex in textureStore.rocketFlame) { pgo.getTextureSet("MainFlame").addTexture(tex); } pgo.getTextureSet("MainFlame").offset = new Vector2(cubeSize.X - 1, 0); foreach (Texture2D tex in textureStore.boomTextures) { pgo.getTextureSet("Boom").addTexture(tex); } /*foreach (Texture2D tex in textureStore.rocketFlame) * pgo.getTextureSet("InternalFlame").addTexture(tex); * * pgo.addTextureSet("InternalFlame");*/ float rotation = 0.0f; switch (cubeDescription.dir) { case Direction.East: rotation = 0; break; case Direction.South: rotation = MathHelper.Pi / 2; break; case Direction.West: rotation = MathHelper.Pi; break; case Direction.North: rotation = MathHelper.Pi * 3 / 2; break; } pgo.boxBody.Rotation = rotation; } else if (cubeDescription.type == CubeType.ShooterCube) { ret = new ShooterCube(cubeDescription.dir); defaultTextureList = textureStore.shooterTextures; ((ShooterCube)ret).bulletTexture = textureStore.bulletTexture; ((ShooterCube)ret).activationCountdownTotal = cubeDescription.value; ((ShooterCube)ret).activationCountdown = cubeDescription.value; float rotation = 0.0f; switch (cubeDescription.dir) { case Direction.East: rotation = 0; break; case Direction.South: rotation = MathHelper.Pi / 2; break; case Direction.West: rotation = MathHelper.Pi; break; case Direction.North: rotation = MathHelper.Pi * 3 / 2; break; } pgo.boxBody.Rotation = rotation; } else if (cubeDescription.type == CubeType.BulletCube) { ret = new BulletCube(); defaultTextureList = textureStore.bulletTexture; pgo.getTextureSet("Default").scale *= 2; } else if (cubeDescription.type == CubeType.ShieldCube) { ret = new ShieldCube(); defaultTextureList = textureStore.shieldTextures; pgo.boxBody.Mass = 1f; foreach (Texture2D tex in textureStore.buzzTextures) { pgo.getTextureSet("Energize").addTexture(tex); } } else// ; if (cubeDescription.type == CubeType.HeavyCube) { ret = new HeavyCube(); pgo.boxBody.Mass = 5; defaultTextureList = textureStore.heavyTextures; pgo.boxBody.Mass = 2f; } foreach (Texture2D tex in defaultTextureList) { pgo.getTextureSet("Default").addTexture(tex); } foreach (Texture2D tex in textureStore.selectTextures) { pgo.getTextureSet("Selected").addTexture(tex); } pgo.addTextureSet("Countdown"); foreach (Texture2D tex in textureStore.rocketTimer) { pgo.getTextureSet("Countdown").addTexture(tex); } for (int i = 1; i <= 8; i++) { string name = "coin" + i; pgo.getTextureSet(name).addTexture(textureStore.coinTexture); pgo.getTextureSet(name).offset.Y += cubeSize.Y + (i * 20); if (cubeDescription.type == CubeType.ChainCube) { pgo.getTextureSet(name).scale *= 40f; pgo.getTextureSet(name).offset.X += cubeSize.X / 2; pgo.getTextureSet(name).offset.Y += cubeSize.Y / 2; } } ret.cubeDescription = cubeDescription; physicsController.registerPhysicsGameObject(pgo); ret.physicalObject = pgo; ret.physicsController = physicsController; ret.parent = parent; ret.hackz0r(); physicsController.nodeLookup[pgo] = ret; return(ret); }