public override void UpdateLogic(OfficeWorld officeWorld, Time timeElapsed) { if (this.associatedToken != this.previousAssociatedToken) { if (this.associatedToken != null) { AToken nextToken = this.NextToken; int i = 0; while (nextToken != null) { if (i == 0) { officeWorld.NotifyTextUpdated(nextToken, nextToken.PreviousToken, this.associatedToken, this.InitialPosition); } else { officeWorld.NotifyTextUpdated(nextToken, nextToken.PreviousToken, null, this.InitialPosition); } i++; nextToken = nextToken.NextToken; } officeWorld.NotifyInternalGameEvent(this.previousAssociatedToken, this.associatedToken, "association"); } this.previousAssociatedToken = this.associatedToken; } base.UpdateLogic(officeWorld, timeElapsed); }
public override void UpdateLogic(OfficeWorld officeWorld, Time TimeElapsed) { if (this.isDialogueLaunched && this.currentTokenRowIndex < this.tokensList.Count) { if (this.currentTokenIndex < 0 || this.tokensList[this.currentTokenRowIndex][this.currentTokenIndex].IsTextFull) { this.currentTokenIndex++; if (this.currentTokenIndex >= this.tokensList[this.currentTokenRowIndex].Count) { this.currentTokenRowIndex++; this.currentTokenIndex = 0; if (this.currentTokenRowIndex != 0 && this.currentTokenRowIndex < this.tokensList.Count && this.currentTokenRowIndex % 8 == 0) { this.ResetUntilRow(this.currentTokenRowIndex); } } if (this.currentTokenRowIndex < this.tokensList.Count && this.currentTokenIndex < this.tokensList[this.currentTokenRowIndex].Count) { Vector2f newPosition = new Vector2f(this.position.X, this.position.Y + (this.currentTokenRowIndex % 8) * this.rowHeight); this.tokensList[this.currentTokenRowIndex][this.currentTokenIndex].InitialPosition = newPosition; this.tokensList[this.currentTokenRowIndex][this.currentTokenIndex].SetKinematicParameters(newPosition, new Vector2f(0, 0)); this.tokensList[this.currentTokenRowIndex][this.currentTokenIndex].LaunchText(this.speedFactor); } } } if (this.IsDialogueFull && this.isDialogueLaunched) { officeWorld.NotifyInternalGameEvent(this, null, "endDialogue"); this.isDialogueLaunched = false; } }