Skip to content

Instantly share code, notes, and snippets.

@jonstvns
Last active December 31, 2015 05:59
Show Gist options
  • Save jonstvns/7944682 to your computer and use it in GitHub Desktop.
Save jonstvns/7944682 to your computer and use it in GitHub Desktop.
public interface IRequirement
{
bool IsComplete {get; set;}
void OnRequirementEvent(IRequirementArgs args);
}
public class TalkArgs : IRequirementArgs
{
public string npcName;
public TalkArgs() { }
public TalkArgs(string npcName)
{
this.npcName = npcName;
}
}
public class TalkRequirement : IRequirement
{
private string npcName;
public string NpcName { get { return npcName; } }
private bool isComplete = false;
public bool IsComplete
{
get { return isComplete; }
set { isComplete = value; }
}
public TalkRequirement() { }
public TalkRequirement(string npcName)
{
this.npcName = npcName;
}
public void OnRequirementEvent(IRequirementArgs args)
{
if (args is TalkArgs)
{
var talkArgs = (TalkArgs)args;
//Do Stuff
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment