Beispiel #1
0
 public Membrane(BaseCreature creature, Random random, Point position, int generation, int parentMark, Creator creator)
 {
     Creature = creature;
     _random = random;
     _parentMark = parentMark;
     Position = position;
     Generation = generation;
     _creator = creator;
 }
Beispiel #2
0
        public override BaseCreature MakeChild(BaseCreature parent)
        {
            var parentAsCreature = parent as Creature;
            if (parentAsCreature == null) throw new ArgumentException();

            var childsDirections = Mutate(parentAsCreature.CommandsForGetDirection);
            var childsActions = Mutate(parentAsCreature.CommandsForGetAction);
            var executor = new Executor();
            var child = new Creature(executor, childsDirections, childsActions);
            return child;
        }
Beispiel #3
0
 public override BaseCreature MakeChild(BaseCreature parent)
 {
     if(!(parent is SimpleCreature))throw new ArgumentException();
     return new SimpleCreature();
 }
Beispiel #4
0
 public abstract BaseCreature MakeChild(BaseCreature parent);