コード例 #1
0
 public void Initialize(IBrainGenetics genetics)
 {
     if (genetics is MyBrainGenetics)
     {
         // initialize internal state according to the genetics
         // if we wish to inherit anything - maybe we don't want any
         // brain inheritance
     }
 }
コード例 #2
0
    // how do we want to store the brain's qualities
    // so they can be inherited?

    // how do we cross them?
    // "this" will always be the mother, while "other" will always be the father
    public IBrainGenetics Cross(IBrainGenetics other)
    {
        if (other is MyBrainGenetics)
        {
            return(new MyBrainGenetics());
        }
        else
        {
            return(null);
        }
    }
コード例 #3
0
 public void Initialize(IBrainGenetics genetics)
 {
     Brain.Initialize(genetics);
 }