Exemplo n.º 1
0
        protected override SceneID GetNextMap(IMovesBetweenScenes actor, BorderSide exitSide)
        {
            var position = actor.Position.Center;

            switch (exitSide)
            {
            case BorderSide.Right:
                position.X = (float)(Scene.Position.Right + actor.Position.Width * 4);
                break;

            case BorderSide.Left:
                position.X = (float)(Scene.Position.Left - actor.Position.Width * 4);
                break;

            case BorderSide.Top:
                position.Y = (float)(Scene.Position.Top - actor.Position.Height * 4);
                break;

            case BorderSide.Bottom:
                position.Y = (float)(Scene.Position.Bottom + actor.Position.Height * 4);
                break;
            }

            position = MasterTemplate.PositionInMapToPointInTemplate(CurrentMap, position);

            var nextMapIndex = MasterTemplate.MapRegions.FindIndex(p => p.Contains(position));

            if (nextMapIndex == -1)
            {
                throw new ArgumentException("Unable to find adjacent map");
            }

            return(new SceneID(CurrentMap.Name, nextMapIndex));
        }
Exemplo n.º 2
0
        private Vector2 CalculateActorStart(IMovesBetweenScenes actorInLastScene, SceneID lastScene, Scene nextScene)
        {
            var templatePosition = MasterTemplate.PositionInMapToPointInTemplate(lastScene, actorInLastScene.Position.Center);

            var nextMapPosition = MasterTemplate.PointInTemplateToPositionInMap(nextScene.ID, templatePosition);

            return(nextMapPosition);
        }
Exemplo n.º 3
0
 public override SceneID GetNextMap(IMovesBetweenScenes actor)
 {
     if (Condition.IsActiveAndNotNull())
     {
         return(Scene);
     }
     else
     {
         return(null);
     }
 }
Exemplo n.º 4
0
        public override SceneID GetNextMap(IMovesBetweenScenes actor)
        {
            var exitSide = Scene.Boundary.GetExitedSide(actor.Position);

            if (exitSide != BorderSide.None)
            {
                return(GetNextMap(actor, exitSide));
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 5
0
 protected abstract SceneID GetNextMap(IMovesBetweenScenes actor, BorderSide exitSide);
Exemplo n.º 6
0
 public abstract SceneID GetNextMap(IMovesBetweenScenes actor);