Is this considered circular dependency? I don't like that part where I have to pass the object itself to IRule... Is there a way to work around this?
public interface IRule
{
void Apply(World world);
}
public class World
{
public List<IRule> Rules { get; set; }
public void ApplyAllRules()
{
foreach (var rule in Rules)
{
//This is the part that I don't feel good about.
rule.Apply(this);
}
}
}