Beispiel #1
0
        private EvolveResult ComputeEvolveResult()
        {
            Dictionary <Space, SpaceEvolveResult> result = new Dictionary <Space, SpaceEvolveResult>();

            foreach (var space in Room.Spaces)
            {
                var nearSpaces = Room.GetNeighbors(space.Location);
                var args       = new RuleArgs(nearSpaces);
                result[space]            = new SpaceEvolveResult();
                result[space].NearSpaces = nearSpaces;
                if (space.HasLife)
                {
                    result[space].LiveRuleFitResult  = m_liveRules.Execute(space.Lives, args);
                    result[space].DeathRuleFitResult = m_deathRules.Execute(space.Lives, args);
                }
                else
                {
                    result[space].RebornRuleFitResult = m_rebornRules.Execute(space.Lives, args);
                }
            }
            return(new EvolveResult(result));
        }