Ejemplo n.º 1
0
        public virtual void Update(FrameTick elapsedTime)
        {
            time += elapsedTime;

            while (TilesToEmit.Count > 0 && time >= TilesToEmit.FrontPriority())
            {
                int priority = TilesToEmit.FrontPriority();
                Loc tile     = TilesToEmit.Dequeue();

                FiniteEmitter tileEmitter = (FiniteEmitter)TileEmitter.Clone();
                tileEmitter.SetupEmit(tile * GraphicsManager.TileSize, User.MapLoc, User.CharDir);
                DungeonScene.Instance.CreateAnim(tileEmitter, DrawLayer.NoDraw);
            }
        }
Ejemplo n.º 2
0
        public void UpdateHitQueue(StablePriorityQueue <int, HitboxHit> hitTargets)
        {
            //when updating, the base will update the time elapsed
            //when this method is reached, hits will be delegated accordingly

            while (TilesToHit.Count > 0 && (Finished || time >= TilesToHit.FrontPriority()))
            {
                int priority = TilesToHit.FrontPriority();
                Loc tile     = TilesToHit.Dequeue();

                //filter out the hitboxes that are not wanted
                TargetHitType type = IsValidTileTarget(tile);
                if (type == TargetHitType.Burst)
                {
                    hitTargets.Enqueue(priority, new HitboxHit(tile, true));
                }
                else if (type == TargetHitType.Tile)
                {
                    hitTargets.Enqueue(priority, new HitboxHit(tile, false));
                }
            }
        }