public override void Execute(float deltaTime, bool repeat) { ImageHolder pImageHolder = (ImageHolder)SLink.GetNext(this.pCurrImage); if (pImageHolder == null) { pImageHolder = (ImageHolder)poHeadImage; } this.pCurrImage = pImageHolder; this.pSprite.SwapImage(pImageHolder.GetpImange()); if (repeat == true) { if (pSprite.name == GameSprite.Name.Squid) { TimerMan.Add(TimerEvent.Name.SquidAnimation, this, deltaTime); } else if (pSprite.name == GameSprite.Name.Crab) { TimerMan.Add(TimerEvent.Name.CrabAnimation, this, deltaTime); } else if (pSprite.name == GameSprite.Name.Octopus) { TimerMan.Add(TimerEvent.Name.OctopusAnimation, this, deltaTime); } else if (pSprite.name == GameSprite.Name.ShipDies) { TimerMan.Add(TimerEvent.Name.AnimShip, this, deltaTime); } } }
public void PrintReport() { Debug.WriteLine("[Animation Sprite: " + pSprite.name + " ]"); Debug.Write("Image List: "); SLink.PrintList(poFirstImage); Debug.WriteLine("\n"); }
public void PrintReport() { Debug.WriteLine("[Composite Motion: "); Debug.Write("Motion List: "); SLink.PrintList(poFirstMotion); Debug.WriteLine(" ]\n"); }
public AnimationSprite(GameSprite.Name spriteName) { this.pSprite = GameSpriteMan.Find(spriteName); Debug.Assert(this.pSprite != null); this.pCurrImage = null; this.poHeadImage = null; }
public void PrintReport() { Debug.WriteLine("[ TimedSoundEffects ]"); Debug.Write("Sound List: "); SLink.PrintList(poFirstSound); Debug.WriteLine("\n"); }
public static Player add(Player.PlayerType playerName) { Player player = new Player(playerName, 0, 3); SLink.addToFront(ref playerList, player); return(player); }
public void Destroy() { pCurrImage = null; pSprite = null; ClearImageList(pFirstImage); pFirstImage = null; }
public MovementSprite(Composite pGrid) { this.pSprites = pGrid; Debug.Assert(this.pSprites != null); this.poHead = null; this.pCurr = null; }
public override void execute(float currentTime) { ImageHolder imageHolder = this.pCurrImage.pNext == null ? (ImageHolder)this.pFirstImage : (ImageHolder)this.pCurrImage.pNext; this.pCurrImage = imageHolder; this.pSprite.SwapImage(imageHolder.pImage); }
public AlienImageAnimation(Sprite.SpriteName spriteGameName) { cSpriteGame = (Sprite)SpriteManager.find(spriteGameName); Debug.Assert(cSpriteGame != null); cCurrImg = null; cImgList = null; }
public SpriteAnimation(SpriteAnimation.Name animationName, Sprite.Name spriteName) { // list this.pFirstImage = null; this.pCurrImage = null; Set(animationName, spriteName); }
public SpriteAnimation() : base() { this.name = SpriteAnimation.Name.Uninitialized; this.pSprite = null; this.pFirstImage = null; this.pCurrImage = null; }
public AnimationSprite(Sprite.Name name) { this.pSprite = SpriteManager.Find(name); Debug.Assert(this.pSprite != null); // initialize references this.pCurrentImage = null; this.poFirstImage = null; }
public AnimateCrab(Animation.Name animName, GameSprite.Name spriteName) : base(animName) { this.poFirstImage = null; this.pCurrentImage = null; this.pSprite = GameSpriteMan.Find(spriteName); Debug.Assert(this.pSprite != null); }
public void Attach(float x, float y, SndObserver pSn) { PositionHoder pPositionHoder = null; pPositionHoder = new PositionHoder(x, y, pSn); Debug.Assert(pPositionHoder != null); SLink.AddToFront(ref this.poHead, pPositionHoder); this.pCurr = pPositionHoder; }
override public void UpdateRange(int delta) { PositionHoder pPositionHoder = (PositionHoder)poHead; while (pPositionHoder != null) { pPositionHoder.SetPositionX(pPositionHoder.GetPositionX() + delta); pPositionHoder = (PositionHoder)SLink.GetNext(pPositionHoder); } }
public static void PrintList(SLink pHead) { SLink tmpNode = pHead; while (tmpNode != null) { Debug.Write(tmpNode + " , "); tmpNode = tmpNode.pNext; } }
public void checkAlienCollision(GameObjectTree tree) { SLink temp = head; while (temp != null) { ((ShieldDataNode)temp).getShield().checkGameObjectTreeCollision(tree); temp = temp.next; } }
public void setAllActive(Status s) { SLink temp = head; while (temp != null) { ((ShieldDataNode)temp).getShield().setAllActive(s); temp = temp.next; } }
public void checkProjectileCollision(ProjectileManager manager) { SLink temp = head; while (temp != null) { manager.sendProjectiles(((ShieldDataNode)temp).getShield()); temp = temp.next; } }
public void Attach(Image.Name imageName) { Image pImage = ImageMan.Find(imageName); Debug.Assert(pImage != null); ImageHolder pImageHolder = new ImageHolder(pImage); Debug.Assert(pImageHolder != null); SLink.AddToFront(ref this.poHeadImage, pImageHolder); this.pCurrImage = pImageHolder; }
public AnimationSprite(GameSprite.Name spriteName) { // initialized the sprite animation is attached to this.pSprite = GameSpriteManager.Find(spriteName); Debug.Assert(this.pSprite != null); // initialize references this.pCurrImage = null; // list this.poFirstImage = null; }
public void setPos(float x, float y, float Xoffset, float Yoffset, int i) { SLink temp = head; while (temp != null && ((ShieldDataNode)temp).getNum() != i) { temp = temp.next; } if (temp != null) { ((ShieldDataNode)temp).getShield().setPos(x, y, Xoffset, Yoffset); } }
public ShieldList(int totalShields) { if (totalShields > 0) { head = new ShieldDataNode(GameObjectTreeFactory.getFactory.makeGameObjectTreeShield(), 0); } for (int i = 1; i < totalShields; i++) { SLink temp = new ShieldDataNode(GameObjectTreeFactory.getFactory.makeGameObjectTreeShield(), i); temp.next = head; head = temp; } }
public void Attach(Sound.Name soundName) { // Create a new holder SoundNameHolder pSoundHolder = new SoundNameHolder(soundName); Debug.Assert(pSoundHolder != null); // Attach it to the TimedSoundEffect ( Push to front ) SLink.AddToFront(ref this.poFirstSound, pSoundHolder); // Set the first one to this Sound this.pCurrentSound = pSoundHolder; }
public static SLink PullFromFront(ref SLink pHead) { Debug.Assert(pHead != null); // Return node SLink pNode = pHead; // Update head pHead = pHead.pNext; pNode.Clear(); return(pNode); }
public void attach(String pSound) { // create a new ImageHolder to hold the image SoundHolder pSoundHolder = new SoundHolder(pSound); Debug.Assert(pSoundHolder != null); // add to front SLink.AddToFront(ref this.poFirstSound, pSoundHolder); // set the first one to this image this.pCurrSound = pSoundHolder; }
public void Attach(Sound.Name soundName) { Sound pSound = SoundMan.Find(soundName); Debug.Assert(pSound != null); SoundHolder pSoundHolder = new SoundHolder(pSound); Debug.Assert(pSoundHolder != null); SLink.AddToFront(ref this.poFirstSound, pSoundHolder); this.pCurrSound = pSoundHolder; }
//Attaches the Image Holder to the front of the list and current image is updated with it. public void attachImg(Image.ImageName imageName) { Image image = (Image)ImageManager.find(imageName); Debug.Assert(image != null); ImageHolder imageHolder = new ImageHolder(image); Debug.Assert(imageHolder != null); SLink.addToFront(ref cImgList, imageHolder); cCurrImg = imageHolder; }
public void Dump() { Debug.Assert(this.pFirstImage != null); Debug.WriteLine(String.Format("AnimationSprite:{0}({1})", this.pSprite.name.ToString(), this.GetHashCode())); Debug.WriteLine(String.Format("CurrentImage:{0}", this.pCurrImage.ToString())); Debug.WriteLine("Images:"); SLink curr = pFirstImage; while (curr != null) { ImageHolder imageHolder = (ImageHolder)curr; Debug.WriteLine("\t\t{0}({1})", imageHolder.pImage.name.ToString(), imageHolder.pImage.GetHashCode()); curr = curr.pNext; } }