|
using System;
using System.Collections;
namespace BotSuite.MyWebAssembly
{
public enum ResponseOperator{
Exact,
Contains,
DoesntContain,
BeginWith,
EndWith,
AnyOfTheWords,
NotAnyOfTheWords,
ContainWords,
DoesnotContainWords
};
/// <summary>
/// Summary description for Response.
/// </summary>
public class Response
{
public string FromNode = "";
public string ToNode = "";
public string ResponseText = "";
public ResponseOperator rspOperator = ResponseOperator.Exact;
public ArrayList events = new ArrayList();
public ArrayList stats = new ArrayList();
public double ratio;
public string id = "";
public int priority = 1;
public Response()
{
}
public Response(string FromNode, string ToNode, string ResponseText, ResponseOperator rspOperator,
double ratio, int priority, string id, ArrayList events, ArrayList stats)
{
this.FromNode = FromNode;
this.ToNode = ToNode;
this.rspOperator = rspOperator;
this.events = events;
this.stats = stats;
this.ResponseText = ResponseText;
this.id = id;
this.priority = priority;
if(ratio != -1)
this.ratio = ratio;
else
{
System.Random rnd = new Random();
ratio = rnd.NextDouble();
int tmp = (int) (ratio * 10);
ratio = ((double)tmp) / 10;
if(ratio < 0.2)
ratio +=0.2;
else if( ratio > 0.8)
ratio -= 0.2;
this.ratio = ratio;
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Mansoor Sarfraz works in a well reputed multinational software development company. Software development is not only his duty but his passion too. In his professional career he was Involved in the development of resource/content management system, workflow based systems, enterprise projects based on MS Windows DNA architecture and .NET framework, web based rich client UI development, Rest based backend web services and windows services for different systems. He was also involved in software designing and architecture. He has expertise in C#.NET, ASP.NET, Sql Server, Adobe Flex, Java, Ajax and JavaScript.
You can reach him through his blog
http://mansoorsarfraz.blogspot.com