-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from maslankam/dev
Dev
- Loading branch information
Showing
20 changed files
with
390 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,49 @@ | ||
using System.Drawing; | ||
using System.Collections.Generic; | ||
using Model.Neighbourhood; | ||
using System.Linq; | ||
|
||
|
||
namespace Model.Microelements{ | ||
|
||
public class Grain : Microelement | ||
{ | ||
public sealed override int? Phase{get; set;} | ||
public sealed override Color Color {get; set;} | ||
public sealed override int Id{get; set;} | ||
public bool GenerateDetails { get; set; } | ||
public CellularAutomaton OwnerAutomaton { get; set; } | ||
public sealed override List<Cell> Members { get; set; } | ||
public sealed override int? Phase { get; set; } | ||
public sealed override Color Color { get; set; } | ||
public sealed override int Id { get; set; } | ||
|
||
public string Info | ||
{ | ||
get => GenerateDetails ? $"Grain Id:{Id}, Phase:{Phase}, Area: {Area}, Border:{Border}" | ||
: $"Grain Id:{Id}, Phase:{Phase}"; | ||
} | ||
|
||
public int Area { get => Members.Count; } | ||
public int Border { get => (Members.Count((n) => n.isBorder == true)); } | ||
|
||
public Grain(int id, int phase, Color color) | ||
{ | ||
Id = id; | ||
Color = color; | ||
Phase = phase; | ||
Members = new List<Cell>(); | ||
GenerateDetails = false; | ||
} | ||
|
||
public override void Delete() | ||
{ | ||
foreach (var member in Members) | ||
{ | ||
member.MicroelementMembership = null; | ||
|
||
} | ||
} | ||
|
||
|
||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.