Exemple #1
0
 public void SetTreatment(Tile tile, TileRotationTreatment treatment)
 {
     GetGroup(tile, out var rg);
     if (rg.Treatment != null && rg.Treatment != treatment)
     {
         throw new Exception($"Cannot set {tile} treatment, inconsistent with {rg.Treatment} of {rg.TreatmentSetBy}");
     }
     rg.Treatment      = treatment;
     rg.TreatmentSetBy = tile;
 }
Exemple #2
0
 // Used by TileRotationBuilder
 internal TileRotation(
     IDictionary <Tile, IDictionary <Rotation, Tile> > rotations,
     IDictionary <Tile, TileRotationTreatment> treatments,
     TileRotationTreatment defaultTreatment,
     RotationGroup rotationGroup)
 {
     this.rotations        = rotations;
     this.treatments       = treatments;
     this.defaultTreatment = defaultTreatment;
     this.rotationGroup    = rotationGroup;
 }
Exemple #3
0
 internal TileRotation(
     IDictionary <Tile, IDictionary <Transform, Tile> > transforms,
     IDictionary <Tile, TileRotationTreatment> treatments,
     TileRotationTreatment defaultTreatment,
     TransformGroup tg)
 {
     this.transforms       = transforms;
     this.treatments       = treatments;
     this.defaultTreatment = defaultTreatment;
     this.tg = tg;
 }
Exemple #4
0
 public TileRotationBuilder(TileRotationTreatment defaultTreatment = TileRotationTreatment.Unchanged)
 {
     this.tg = new TransformGroup();
     this.defaultTreatment = defaultTreatment;
 }
Exemple #5
0
 /// <summary>
 /// Constructs a TileRotation that allows rotations and reflections as passed in,
 /// but leaves all tiles unchanged when rotating.
 /// <paramref name="rotationalSymmetry"></paramref>
 /// </summary>
 /// <param name="rotationalSymmetry">Permits rotations of 360 / rotationalSymmetry</param>
 /// <param name="reflectionalSymmetry">If true, reflections in the x-axis are permited</param>
 public TileRotation(int rotationalSymmetry, bool reflectionalSymmetry)
 {
     this.treatments       = new Dictionary <Tile, TileRotationTreatment>();
     this.defaultTreatment = TileRotationTreatment.Unchanged;
     this.rotationGroup    = new RotationGroup(rotationalSymmetry, reflectionalSymmetry);
 }
 public TileRotationBuilder(int rotationalSymmetry, bool reflectionalSymmetry, TileRotationTreatment defaultTreatment = TileRotationTreatment.Unchanged)
 {
     this.rotationGroup    = new RotationGroup(rotationalSymmetry, reflectionalSymmetry);
     this.defaultTreatment = defaultTreatment;
 }
Exemple #7
0
 internal TileRotation(TileRotationTreatment defaultTreatment = TileRotationTreatment.Unchanged)
 {
     this.treatments       = new Dictionary <Tile, TileRotationTreatment>();
     this.defaultTreatment = defaultTreatment;
 }
 public TileRotationBuilder(RotationGroup rotationGroup, TileRotationTreatment defaultTreatment = TileRotationTreatment.Unchanged)
 {
     this.rotationGroup    = rotationGroup;
     this.defaultTreatment = defaultTreatment;
 }