public void InterfaceProperty() { Interface it = new Interface(controller, "Interface1"); InterfaceProperty item = new InterfaceProperty(controller, "Property1", new DataType(controller, "int")); Assert.That(item.FullyQualifiedDisplayName, Is.EqualTo("Property1")); it.AddChild(item); Namespace ns = new Namespace(controller); ns.Name = "ns1"; ns.AddChild(it); Assert.That(item.FullyQualifiedDisplayName, Is.EqualTo("ns1.Interface1.Property1")); }
public void InterfaceEvent() { Interface it = new Interface(controller, "Interface1"); InterfaceEvent item = new InterfaceEvent(controller, "Event1", new DataType(controller, "Delegate1"), false); Assert.That(item.FullyQualifiedDisplayName, Is.EqualTo("Event1")); it.AddChild(item); Namespace ns = new Namespace(controller); ns.Name = "ns1"; ns.AddChild(it); Assert.That(item.FullyQualifiedDisplayName, Is.EqualTo("ns1.Interface1.Event1")); }
public void InterfaceMethod() { Interface it = new Interface(controller, "Interface1"); InterfaceMethod item = new InterfaceMethod(controller, "Function1", new DataType(controller, "int")); item.Parameters.Add(new Parameter(controller, "float", "f")); item.Parameters.Add(new Parameter(controller, "InputObject", "j")); Assert.That(item.FullyQualifiedDisplayName, Is.EqualTo("Function1 (float, InputObject)")); it.AddChild(item); Namespace ns = new Namespace(controller); ns.Name = "ns1"; ns.AddChild(it); Assert.That(item.FullyQualifiedDisplayName, Is.EqualTo("ns1.Interface1.Function1 (float, InputObject)")); }
public void InterfaceIndexer() { Interface it = new Interface(controller, "Interface1"); InterfaceIndexer item = new InterfaceIndexer(controller, new DataType(controller, "int"), false); item.Parameters.Add(new Parameter(controller, "float", "f")); item.Parameters.Add(new Parameter(controller, "InputObject", "j")); Assert.That(item.FullyQualifiedDisplayName, Is.EqualTo("Indexer [float, InputObject]")); it.AddChild(item); Namespace ns = new Namespace(controller); ns.Name = "ns1"; ns.AddChild(it); Assert.That(item.FullyQualifiedDisplayName, Is.EqualTo("ns1.Interface1.Indexer [float, InputObject]")); }
protected CodeRoot CreateNamespaceAndInterface(IBaseConstruct inter) { Interface interface1 = new Interface(controller, "Interface1"); interface1.Modifiers.Add("public"); interface1.AddChild(inter); AttributeSection attrs = new AttributeSection(controller); Attribute attr = new Attribute(controller); attr.PositionalArguments.Add("true"); attr.Name = "Serializable"; attrs.AddAttribute(attr); interface1.AddAttributeSection(attrs); Namespace ns = new Namespace(controller); ns.Name = "ArchAngel.Tests"; ns.AddChild(interface1); CodeRoot root = new CodeRoot(controller); root.AddChild(ns); return(root); }
public void InterfaceAccessor() { InterfaceProperty itp = new InterfaceProperty(controller, "Property1", new DataType(controller, "int")); InterfaceAccessor item1 = new InterfaceAccessor(controller, ArchAngel.Providers.CodeProvider.DotNet.InterfaceAccessor.AccessorTypes.Get, ""); InterfaceAccessor item2 = new InterfaceAccessor(controller, ArchAngel.Providers.CodeProvider.DotNet.InterfaceAccessor.AccessorTypes.Set, ""); itp.AddChild(item1); itp.AddChild(item2); Assert.That(item1.FullyQualifiedDisplayName, Is.EqualTo("Property1.Get Accessor")); Assert.That(item2.FullyQualifiedDisplayName, Is.EqualTo("Property1.Set Accessor")); Interface it = new Interface(controller, "Interface1"); it.AddChild(itp); Namespace ns = new Namespace(controller); ns.Name = "ns1"; ns.AddChild(it); Assert.That(item1.FullyQualifiedDisplayName, Is.EqualTo("ns1.Interface1.Property1.Get Accessor")); Assert.That(item2.FullyQualifiedDisplayName, Is.EqualTo("ns1.Interface1.Property1.Set Accessor")); }
public void initGame() { cameraHeight = (float)Convert.ToDouble(Support.GameParameters["StartingCameraHeight"]); //set view close to the scene this.Camera2D.SetViewFromHeightAndCenter(cameraHeight, Sce.PlayStation.HighLevel.GameEngine2D.Base.Math._00); //add all sprites loaded from the map foreach (SpriteList sl in MapManager.Instance.currentMap.spriteList) { Background.AddChild(sl); } //load the fire texture for the bullet Bullet.fireTexture = new Texture2D("/Application/data/tiles/fire.png", false); //texture for the points marker pointMarker.texture = new Texture2D("/Application/data/points100.png", false); //texture for the ammo marker ammoMarker.texture = new Texture2D("/Application/data/plusammo.png", false); Player.Instance = new Player(); Foreground.AddChild(Player.Instance); //create the list for bullets bulletList = new List <Bullet>(); //create ammo packs ammoList = new List <AmmoItem>(); List <MapTile> list = MapManager.Instance.currentMap.returnTilesOfType(MapTile.Types.floor); //add a specified number of ammo packs for (int i = 0; i < AmmoItem.noOfAmmoToGenerate; i++) { AmmoItem a = new AmmoItem(list[Support.random.Next(0, list.Count - 1)].position); ammoList.Add(a); World.AddChild(a); } //create the quad tree quadTree = new QuadTree(new Vector2(MapManager.Instance.currentMap.width / 2.0f, MapManager.Instance.currentMap.height / 2.0f), new Vector2(MapManager.Instance.currentMap.width / 2.0f, MapManager.Instance.currentMap.height / 2.0f)); //create enemies var tex = new Texture2D("/Application/data/tiles/enemy_sword2.png", false); tex.SetFilter(TextureFilterMode.Disabled); tex.SetWrap(TextureWrapMode.ClampToEdge); var texture = new TextureInfo(tex, new Vector2i(25, 1)); //spritelist for the enemies enemySpriteList = new SpriteList(texture) { BlendMode = BlendMode.Normal }; //spriteList.EnableLocalTransform = true; enemyList = new List <Enemy>(); list = MapManager.Instance.currentMap.returnTilesOfType(MapTile.Types.floor); //generate a given number of enemies for (int i = 0; i < BasicEnemy.noOfEnemiesToGenerate; i++) { Enemy e = new BasicEnemy(list[Support.random.Next(0, list.Count - 1)].position, texture); enemyList.Add(e); enemySpriteList.AddChild(((BasicEnemy)e).sprite); EffectsLayer.AddChild(e); quadTree.insert(e); } Foreground.AddChild(enemySpriteList); ui = new UI(); Interface.AddChild(ui); //add an enemy spawner every second Sce.PlayStation.HighLevel.GameEngine2D.Scheduler.Instance.Schedule(this, (dt) => { list = MapManager.Instance.currentMap.returnTilesOfType(MapTile.Types.floor); EnemySpawnPoint esp = new EnemySpawnPoint(list[Support.random.Next(0, list.Count - 1)].position); World.AddChild(esp); ; }, 1.0f, false, -1); }