protected override void Display(DialogueContext context) { if (options.Count == 0) { throw new System.Exception("Error while displaying DialogActiveChoice : options can't be empty."); } context.ShowChoice(options); }
protected virtual void BeginInteractiveRoutine(DialogueContext context) { this.context = context; // trigger the effects of the node once // BEWARE! if there are waits in those, behaviour isn't defined! DoEffects(context); // node takes over! context.VisitNode(null); }
public virtual bool DoEffect(DialogueContext context) { if (currentEffectIndex == handlers.Count) { currentEffectIndex = 0; return(false); } handlers[currentEffectIndex++].Handle(context); return(true); }
public override DialogueNode Next(DialogueContext context) { currentNodeIndex++; if (currentNodeIndex == nodes.Count) { currentNodeIndex = 0; return(context.GetDialogueNode(nextNodeId)); } return(this); }
public override void Visit(DialogueContext context) { if (currentNodeIndex == 0) { DoEffects(context); } if (currentNodeIndex < nodes.Count) { currentNode.Visit(context); } }
public bool AreConditionsVerified(DialogueContext context) { foreach (string condition in conditions) { if (!context.GetCondition(condition)) { return(false); } } return(true); }
public override bool DoEffect(DialogueContext context) { if (currentEffectIndex == 0) { if (AreConditionsVerified(context)) { return(base.DoEffect(context)); } } else { return(base.DoEffect(context)); } return(false); }
public override void Visit(DialogueContext context) { if (options.Count == 0) { throw new System.Exception("Error while visiting DialoguePassiveChoice : options can't be empty."); } foreach (DialoguePassiveOption option in options) { if (option.AreConditionsVerified(context)) { nextNodeId = option.nextNodeId; break; } } if (nextNodeId == -1) { throw new System.Exception("Error while checking DialogPassiveChoice : no outcome."); } DoEffects(context); }
public override void Handle(DialogueContext context) { context.SnapSpriteToPosition(objectId, position, snapPosition); }
public override void Handle(DialogueContext context) { context.SetSpritePosition(objectId, position); }
public override void Handle(DialogueContext context) { context.SetContextObject(objectId, o); }
public override void Handle(DialogueContext context) { context.FreeCondition(condition); }
public override void Handle(DialogueContext context) { context.ScaleSprite(objectId, scaleDuration, targetSize); }
public override void Visit(DialogueContext context) { BeginInteractiveRoutine(context); }
public virtual DialogueNode Next(DialogueContext context) { return(null); }
protected virtual void Display(DialogueContext context) { }
public override DialogueNode Next(DialogueContext context) { return(context.GetDialogueNode(nextNodeId)); }
public override void Handle(DialogueContext context) { context.Wait(duration); }
public override void Handle(DialogueContext context) { context.FlipSprite(objectId, flipX, flipY); }
public override void Handle(DialogueContext context) { context.SetAudioSource(objectId, assetPath); }
public override void Handle(DialogueContext context) { context.MoveSprite(objectId, moveDuration, targetPosition, targetSnapPosition); }
public override void Handle(DialogueContext context) { context.StopAudio(); }
public override void Handle(DialogueContext context) { context.PlayMusic(objectId); }
public virtual void Visit(DialogueContext context) { DoEffects(context); Display(context); }
public override void Handle(DialogueContext context) { context.StopMusic(); }
protected override void Display(DialogueContext context) { context.SetName(name); context.SetText(text); }
public abstract void Handle(DialogueContext context);
public override void Handle(DialogueContext context) { context.SetSpriteVisible(objectId, visible); }
public override void Handle(DialogueContext context) { context.FreeContextObject(objectId); }
public override void Handle(DialogueContext context) { context.SetSpriteSize(objectId, size); }