コード例 #1
0
 IEnumerable <Quardant> YouthWaysOn(Quardant quardant, CellsGroup group)
 {
     return(quardant.neighbours.Where(x => !x.ContainYouthOf(this, group.generation) &&
                                      !x.ContainParentsOf(group) &&
                                      !x.ContainPredecessorOf(group)
                                      ));
 }
コード例 #2
0
        public CellsGroup Propagate()
        {
            var n = new CellsGroup()
            {
                id           = tribe.GenId(),
                generation   = generation + 1,
                precursorId  = id,
                precursor    = this,
                pole         = pole,
                tribe        = tribe,
                propagation  = propagation,
                amount       = 0,
                quadrantFree = 0,
            };

            propagations.Add(n);
            tribe.groups.Add(n);

            return(n);
        }
コード例 #3
0
 public bool IsOlderThan(CellsGroup x)
 {
     return(SameDimension(x) &&
            x.generation > this.generation);
 }
コード例 #4
0
 public bool IsPredecessorOf(CellsGroup x)
 {
     return(SameDimension(x) &&
            this.generation == x.generation - 1);
 }
コード例 #5
0
 public bool IsParentOf(CellsGroup x)
 {
     return(SameDimension(x) &&
            x.precursorId == this.id);
 }
コード例 #6
0
 public bool SameDimension(CellsGroup x)
 {
     return(x.tribe == this.tribe &&
            x.pole == this.pole);
 }
コード例 #7
0
 public bool ContainPredecessorOf(CellsGroup group)
 {
     return(content.Exists(x => x.IsPredecessorOf(group)));
 }
コード例 #8
0
 public bool ContainOlderThan(CellsGroup group)
 {
     return(content.Exists(x => x.IsOlderThan(group)));
 }
コード例 #9
0
 public bool ContainParentsOf(CellsGroup group)
 {
     return(content.Exists(x => x.IsParentOf(group)));
 }