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)); }
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); }
public override SceneID GetNextMap(IMovesBetweenScenes actor) { if (Condition.IsActiveAndNotNull()) { return(Scene); } else { return(null); } }
public override SceneID GetNextMap(IMovesBetweenScenes actor) { var exitSide = Scene.Boundary.GetExitedSide(actor.Position); if (exitSide != BorderSide.None) { return(GetNextMap(actor, exitSide)); } else { return(null); } }
protected abstract SceneID GetNextMap(IMovesBetweenScenes actor, BorderSide exitSide);
public abstract SceneID GetNextMap(IMovesBetweenScenes actor);