using System; using System.Text.RegularExpressions; public class CoalmakingMessageParser { private Regex reStart = new Regex("You start to work with the (dirt|log) on the pile"); private Regex reEnd = new Regex("You attach the (dirt|log) to the pile|You almost made it, but the (dirt|log) is damaged"); private Regex reSkill = new Regex("Coal-making increased"); public bool isActionStart(String message) { return reStart.IsMatch(message); } public bool isActionEnd(String message) { return reEnd.IsMatch(message); } public bool isSkillGain(String message) { return reSkill.IsMatch(message); } public String getName() { return "Coalmaking"; } }