Skip to content

Instantly share code, notes, and snippets.

public Position WalkNorth()
{
var player = GetPlayer();
player.Move("N");
return player.NewPosition;
}
public Position WalkSouth()
{
var player = GetPlayer();
public Position Walk(string direction)
{
var player = GetPlayer();
player.Move(direction);
return player.NewPosition;
}
public int FindIntMatch(int i)
{
var match = (int)container.Get(i);
return match;
}
public string FindStringMatch(string s)
{
var match = (string)container.Get(s);
return match;
public T FindMatch(T t)
{
var match = (T)container.Get(t);
return match;
}
public void GoForRun()
{
GetDressed();
Run();
Shower();
}
public void LiftWeights()
{
GetDressed();
public void DoFitnessActivity(Action activity)
{
GetDressed();
activity();
Shower();
}
public void DoCall()
{
ShowProgressDialog();
RemoteService.DoAsync(CallBackMethod);
}
public void CallBackMethod(Result result)
{
HideProgressDialog();
// Process result;
UIServiceCaller.ExecuteAsync(RemoteService.DoAsync, CallBackMethod);
public static void ExecuteAsync(Action<Action<Result>> asyncMethod, Action callback)
{
ShowProgressDialog();
Action wrappedCallback = (r =>
{
DismissProgressDialog();
callback(r);
}
@simpleprogrammer-shared
simpleprogrammer-shared / validate-user-input-not-developer-input.cs
Created July 11, 2016 09:43
Validate User Input, Not Developer Input
var milkShakeMaker = new MilkShakeMaker();
var shake = milkShakeMaker.MakeShake(icecubes, milk, ingredients);
public class MileShakeMaker
{
public Shake MakeShake(IEnumerable iceCubes,
IMilk milk,
IEnumerable ingredients)
{
if(ice == null || milk == null || ingredient == null)