Esempio n. 1
0
 /// <summary>
 /// Signal Client(s) of the solution result obtained from solving the problem using a given strategy
 /// </summary>
 /// <param name="strategy">Identifiable name for the <see cref="WaterBucket.Domain.ISolutionStrategy"/> used to solve the problem and reaching this <see cref="WaterBucket.Domain.SolutionResult"/></param>
 /// <param name="result">The <see cref="WaterBucket.Domain.SolutionResult"/> from using a specific <see cref="WaterBucket.Domain.ISolutionStrategy"/> to solve the <see cref="WaterBucket.Domain.Problem"/></param>
 /// <seealso cref="ProblemSolutionCompleted"/>
 protected void SignalSolution(string strategy, SolutionResult result)
 {
     if (BroadcastAll)
     {
         Clients.All.problemSolution(strategy, result);
     }
     else
     {
         Clients.Caller.problemSolution(strategy, result);
     }
 }
 public override void RemoteResult(SolutionResult result)
 {
     _result = result;
     _stepsTaken = result.NumberOfActions;
     WaterSource = new Reservoire(result.EndingReservoireState);
 }
Esempio n. 3
0
 public abstract void RemoteResult(SolutionResult result);
Esempio n. 4
0
 public static SolutionResult GetFromBytes(byte[] data, ref int offset, Encoding textEncoding = null)
 {
     SolutionResult sr = new SolutionResult();
     offset = sr.FromBytes(data, offset, textEncoding);
     return sr;
 }