本文整理汇总了C#中Conversation类的典型用法代码示例。如果您正苦于以下问题:C# Conversation类的具体用法?C# Conversation怎么用?C# Conversation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Conversation类属于命名空间,在下文中一共展示了Conversation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssignConnectors
private void AssignConnectors(DialogueEntry entry, Conversation conversation, HashSet<string> alreadyConnected, HashSet<int> entriesVisited, int level)
{
// Sanity check to prevent infinite recursion:
if (level > 10000) return;
// Set non-connectors:
foreach (Link link in entry.outgoingLinks) {
if (link.originConversationID == link.destinationConversationID) {
string destination = string.Format("{0}.{1}", link.destinationConversationID, link.destinationDialogueID);
if (alreadyConnected.Contains(destination)) {
link.isConnector = true;
} else {
link.isConnector = false;
alreadyConnected.Add(destination);
}
}
}
// Then process each child:
foreach (Link link in entry.outgoingLinks) {
if (link.originConversationID == link.destinationConversationID) {
if (!entriesVisited.Contains(link.destinationDialogueID)) {
entriesVisited.Add(link.destinationDialogueID);
var childEntry = conversation.GetDialogueEntry(link.destinationDialogueID);
if (childEntry != null) {
AssignConnectors(childEntry, conversation, alreadyConnected, entriesVisited, level + 1);
}
}
}
}
}
示例2: BeginCinematic
public void BeginCinematic(Type CinematicType)
{
// Disable player input
// Hide castle UI
// Handle enum types
switch(CinematicType)
{
case Type.HoarderConversation:
// NOTE (zesty): For special types, always use index 0, the list is used for other types that have
// a randomization feature
Conv = GameData.Cinematics[CinematicType][0];
break;
case Type.RandomExclamation:
Conv = GameData.Cinematics[CinematicType][Random.Range(0, GameData.Cinematics[CinematicType].Count)];
break;
}
// TESTING
//Conv = GameData.Cinematics[Type.RandomExclamation][3];
LetterDelay = Conv.LetterDelay;
TimeToNextLetter = LetterDelay;
SentenceIndex = 0;
LetterIndex = 0;
CurSentence = Conv.Sentences[SentenceIndex];
CurTextBox = GetTextBox(CurSentence.OwningTextBox);
SetTextBoxVisible(CurTextBox, true);
bSentenceComplete = false;
if(Conv.PauseGame)
App.inst.SpawnController.PauseEnemiesForCinematic();
}
示例3: testConversation
// Testing Conversation class
void testConversation () {
Conversation conversation = new Conversation("Text/SampleDialogue");
Debug.Log(conversation.GetCurrentDialogue());
}
示例4: Start
// Use this for initialization
void Start()
{
mConver = transform.FindChild("Anchor_T/Conver");
if (mConver == null) return;
mUIConver = mConver.GetComponent<Conversation>();
}
示例5: RunConversationCoroutine
private IEnumerator RunConversationCoroutine(Conversation conversation)
{
IsInProgress = true;
Coroutine alignCoroutine = conversation.alignCharacters ? StartCoroutine(AlignCharactersCoroutine()) : null;
if (conversation.controlCamera)
camera.target = conversationTarget;
foreach(DialogCard card in conversation.Cards())
{
dialog.SetDialogQueue(card);
dialog.DisplayNextCard();
while (dialog.IsDisplaying())
yield return null;
yield return null;
}
if (alignCoroutine != null)
StopCoroutine(alignCoroutine);
camera.target = teaganFollowTarget;
IsInProgress = false;
}
示例6: Post
public IHttpActionResult Post(ConversationRequestModel model)
{
if (!this.ModelState.IsValid)
{
return this.BadRequest(this.ModelState);
}
var topic = this.data.Conversations.Select(x => x.Topic).FirstOrDefault();
var text = this.data.Conversations.Select(x => x.Text).FirstOrDefault();
var startedOn = this.data.Conversations.Select(x => x.StartedOn).FirstOrDefault();
var currentUserName = this.User.Identity.Name;
var currentUser = this.data.Users.Where(u => u.UserName == currentUserName).FirstOrDefault();
var conversationToAdd = new Conversation
{
Topic = model.Topic,
Text = model.Text,
StartedOn = model.StartedOn,
Author = currentUser
};
this.data.Conversations.Add(conversationToAdd);
this.data.SaveChanges();
PubNubNotificationProvider.Notify(conversationToAdd.Topic);
return this.Ok(conversationToAdd.Id);
}
示例7: WhisperWindow
public WhisperWindow(Conversation conversation, Participant participant, SeriousBusinessCat seriousBusiness, string info)
{
this.conversation = conversation;
this.participant = participant;
this.seriousBusiness = seriousBusiness;
InitializeComponent();
this.DataContext = this;
InitCommands();
this.Activated += (s,e) => { FlashWindow.Stop(this); };
lbWhispers.ItemsSource = _whispers;
string bob = "neighbor cat";
if (participant != null)
{
bob = participant.Contact.GetContactInformation(ContactInformationType.DisplayName).ToString();
}
textBlock.Text = bob;
if (!string.IsNullOrEmpty(info))
{
textBlock.ToolTip = info;
}
this.Title = $"Whispering with {bob}";
FocusManager.SetFocusedElement(this, tbMessage);
}
示例8: CreateConference
private async Task CreateConference()
{
_confConversation = new Conversation(_endpoint);
var options = new ConferenceJoinOptions() { JoinMode = JoinMode.TrustedParticipant, AdHocConferenceAccessLevel = ConferenceAccessLevel.Everyone, AdHocConferenceAutomaticLeaderAssignment = AutomaticLeaderAssignment.Everyone };
await _confConversation.ConferenceSession.JoinAsync(options);
Console.WriteLine("New conference created");
}
示例9: Write_TwoMessagesOnDifferentDays_TwoDaysGenerated
public void Write_TwoMessagesOnDifferentDays_TwoDaysGenerated()
{
var writer = new MoqWriter();
var message1 = Factory.Create<Message>();
var message2 = Factory.Create<Message>();
message1.Date = message2.Date.AddDays( 1 );
var conversation = new Conversation
{
ContactName = Factory.Create<string>(),
PhoneNumber = Factory.Create<string>(),
Messages = new List<Message> { message1, message2 }
};
ConversationFile file = new ConversationFile( conversation, Factory.Create<string>() );
file.Write( writer );
string expectedResult = string.Concat(
Common.GetExpectedHead( conversation.ContactName ),
GetExpectedPageHeader( conversation ),
"<div class='day'>",
GetExpectedDayTitle( message1.Date ),
GetExpectedMessageBody( message1 ),
"</div><div class='day'>",
GetExpectedDayTitle( message2.Date ),
GetExpectedMessageBody( message2 ),
"</div></body></html>" );
Assert.AreEqual( expectedResult, writer.Data );
}
示例10: Hyperlink_Click
private void Hyperlink_Click(object sender, RoutedEventArgs e)
{
BusinessLayer.ConversationManager cm = new BusinessLayer.ConversationManager();
EntityLayer.Conversation c;
if(AddNum.Text.Length > 0)
{
c = cm.getConversationsFromContact(AddNum.Text);
if (c == null)
{
cm.AddConversation(new EntityLayer.Contact(AddNum.Text));
IList<EntityLayer.Conversation> convs = cm.getConversations();
ViewModel.Conversation.ConversationsModelView cmv = new ViewModel.Conversation.ConversationsModelView(convs);
parent.ListConversations.DataContext = cmv;
}
if (!parent.findConvos(AddNum.Text))
{
Conversation cw = new Conversation(parent, AddNum.Text);
parent.addConv(cw);
cw.Show();
}
this.Close();
}
}
示例11: EstablishCall
private void EstablishCall()
{
// Create a new Conversation.
Conversation conversation = new Conversation(_appEndpoint);
// Create a new IM call.
_imCall = new InstantMessagingCall(conversation);
try
{
// Establish the IM call.
_imCall.BeginEstablish(_destinationSipUri,
new CallEstablishOptions(),
result =>
{
try
{
// Finish the asynchronous operation.
_imCall.EndEstablish(result);
}
catch (RealTimeException ex)
{
// Catch and log exceptions.
_logger.Log("Failed establishing IM call", ex);
}
},
null
);
}
catch (InvalidOperationException ioex)
{
_logger.Log("Failed establishing IM call", ioex);
}
}
示例12: StartConversation
/// <summary>
/// Starts the conversation with another game object.
/// </summary>
/// <param name="obj">Object.</param>
public void StartConversation(GameObject obj, string reply = null)
{
// cannot start another conversation if we have an active one
if (activeConversation != null) {
return;
}
ConversationSet conversationSet = obj.GetComponent<ConversationSet>();
if (conversationSet != null) {
activeConversation = conversationSet.GetActiveConversation();
if (reply != null && reply != "") {
activeConversation.headerText = reply;
}
// disable rigidbody while in conversation
if (_state != null) {
_state.state = State.DISABLED;
}
obj.SendMessage(eventName, SendMessageOptions.DontRequireReceiver);
if (uiPrefab != null) {
// TODO: finish this
_uiShown = Instantiate(uiPrefab) as GameObject;
_buttons = _uiShown.GetComponentsInChildren<Button>();
for (int i = 0; i < _buttons.Length; ++i) {
// Button.ButtonClickedEvent ev = new Button.ButtonClickedEvent();
// ev.AddListener(
// _buttons[i].onClick += OnResponseClick;
}
Button button;
}
}
}
示例13: InterpretComparison
private static BooleanOperand InterpretComparison(string code, string defaultNPCName, Conversation conversation)
{
string comparisonOperator;
int operatorIndex;
if (code.Contains(">=")){
comparisonOperator = ">=";
} else if (code.Contains("<=")){
comparisonOperator = "<=";
} else if (code.Contains("!=")){
comparisonOperator = "!=";
} else if (code.Contains("=")){
comparisonOperator = "=";
} else if (code.Contains(">")){
comparisonOperator = ">";
} else if (code.Contains("<")){
comparisonOperator = "<";
} else {
comparisonOperator = null;
}
if (comparisonOperator == null){
throw new InvalidScriptException("No comparison operator: " + code);
} else {
operatorIndex = code.IndexOf(comparisonOperator);
string firstPart = code.Substring(0, operatorIndex);
string lastPart = code.Substring(operatorIndex + comparisonOperator.Length);
if (code.Contains("$")){
return InterpretStringComparison(firstPart, lastPart, comparisonOperator, operatorIndex, defaultNPCName, conversation);
} else {
return InterpretNumericComparison(firstPart, lastPart, comparisonOperator, operatorIndex, defaultNPCName, conversation);
}
}
}
示例14: GetSituation
public GetSituation(Conversation conversation)
{
if (conversation == null){
Debug.LogError("GetSituation.GetSituation(): NULL CONVERSATION!");
}
this.conversation = conversation;
}
示例15: StoreConversation
private static void StoreConversation(Conversation conversation, string ConversationID)
{
ActiveConversations.Add(ConversationID, new ConversationContainer()
{
Conversation = conversation,
ConversationCreated = DateTime.Now
});
}