public static ShieldBlock create(ShieldBlock.LeftTopBlock type, Index index, float x, float y) { ShieldBlock block; if (index.Equals(Index.Index_0)) { block = new ShieldBlock(GameObject.Name.Shields, index, SpriteEnum.LeftTop_0, x, y); } else if (index.Equals(Index.Index_1)) { block = new ShieldBlock(GameObject.Name.Shields, index, SpriteEnum.LeftTop_1, x, y); } else if (index.Equals(Index.Index_2)) { block = new ShieldBlock(GameObject.Name.Shields, index, SpriteEnum.LeftTop_2, x, y); } else { block = new ShieldBlock(GameObject.Name.Shields, index, SpriteEnum.LeftTop_3, x, y); } GameObjectManager.insert(block, Instance.root); Instance.batch.attach(block.Spr); SpriteBatchManager.attachToGroup(block.ColObj.Spr, BatchGroup.BatchType.Collisions); return block; }
public static ShieldBlock create(ShieldBlock.Block type, Index index, float x, float y) { ShieldBlock block = new ShieldBlock(GameObject.Name.Shields, index, SpriteEnum.ShieldBlock, x, y); GameObjectManager.insert(block, Instance.root); Debug.Assert(block.Spr != null); Instance.batch.attach(block.Spr); SpriteBatchManager.attachToGroup(block.ColObj.Spr, BatchGroup.BatchType.Collisions); return block; }
public override void visitShield(ShieldBlock v, CollisionPair p) { p.notify(v, this); }
public override void visitShield(ShieldBlock v, CollisionPair p) { p.collision(v, (GameObject)this.child); }
public virtual void visitShield(ShieldBlock v, CollisionPair p) { Debug.Assert(false, "Shouldn't have been called"); }
public static ShieldBlock create(ShieldBlock.RightBottomBlock type, Index index, float x, float y) { ShieldBlock block; if (index.Equals(Index.Index_0)) { block = new ShieldBlock(GameObject.Name.Shields, index, SpriteEnum.RightBottom_0, x, y); } else if (index.Equals(Index.Index_1)) { block = new ShieldBlock(GameObject.Name.Shields, index, SpriteEnum.RightBottom_1, x, y); } else { block = null; } Debug.Assert(block != null); GameObjectManager.insert(block, Instance.root); Instance.batch.attach(block.Spr); SpriteBatchManager.attachToGroup(block.ColObj.Spr, BatchGroup.BatchType.Collisions); return block; }
public override void visitShield(ShieldBlock v, CollisionPair p) { GameObject shieldBlock = v; while (shieldBlock.Sibling != null) { shieldBlock = (GameObject)shieldBlock.Sibling; } p.notify(shieldBlock, this); }
public virtual void Visit(ShieldBlock b) { }