Exemplo n.º 1
0
        protected override Element GenerateElement(IEnumerable <Element> possibleElements)
        {
            var element   = possibleElements.First();
            var generated = Parent.RequestElement(PeriodicTable.GetMetalOrLower(element));

            if (generated != element)
            {
                CommandSequence.Add(CommandType.PrepareToGenerate, element, this);
                CommandSequence.Add(CommandType.Consume, generated, this);
                GenerateMetal(generated, element);
            }
            else
            {
                PassThrough(generated);
            }

            return(element);
        }