Class AdjacentModel
AdjacentModel constrains which tiles can be placed adjacent to which other ones.
It does so by maintaining for each tile, a list of tiles that can be placed next to it in each direction.
The list is always symmetric, i.e. if it is legal to place tile B directly above tile A, then it is legal to place A directly below B.
Inheritance
AdjacentModel
Assembly: DeBroglie.dll
Syntax
public class AdjacentModel : TileModel
Constructors
|
Edit this page
View Source
AdjacentModel()
Constructs an AdjacentModel.
Declaration
|
Edit this page
View Source
AdjacentModel(DirectionSet)
Constructs an AdjacentModel.
Declaration
public AdjacentModel(DirectionSet directions)
Parameters
|
Edit this page
View Source
AdjacentModel(ITopoArray<Tile>)
Constructs an AdjacentModel and initializees it with a given sample.
Declaration
public AdjacentModel(ITopoArray<Tile> sample)
Parameters
Properties
|
Edit this page
View Source
Tiles
Declaration
public override IEnumerable<Tile> Tiles { get; }
Property Value
Overrides
Methods
|
Edit this page
View Source
AddAdjacency(Adjacency)
Declaration
public void AddAdjacency(AdjacentModel.Adjacency adjacency)
Parameters
|
Edit this page
View Source
AddAdjacency(Tile, Tile, Direction)
Declares that dest can be placed adjacent to src, in the direction specified.
Declaration
public void AddAdjacency(Tile src, Tile dest, Direction d)
Parameters
|
Edit this page
View Source
AddAdjacency(Tile, Tile, int, int, int)
Declares that dest can be placed adjacent to src, in the direction specified by (x, y, z).
(x, y, z) must be a valid direction, which usually means a unit vector.
Declaration
public void AddAdjacency(Tile src, Tile dest, int x, int y, int z)
Parameters
|
Edit this page
View Source
AddAdjacency(IList<Tile>, IList<Tile>, Direction)
Declares that the tiles in dest can be placed adjacent to the tiles in src, in the direction specified by (x, y, z).
(x, y, z) must be a valid direction, which usually means a unit vector.
Declaration
public void AddAdjacency(IList<Tile> src, IList<Tile> dest, Direction dir)
Parameters
|
Edit this page
View Source
AddAdjacency(IList<Tile>, IList<Tile>, Direction, TileRotation)
Declares that the tiles in dest can be placed adjacent to the tiles in src, in the direction specified.
Then it adds similar declarations for other rotations and reflections, as specified by rotations.
Declaration
public void AddAdjacency(IList<Tile> src, IList<Tile> dest, Direction dir, TileRotation tileRotation = null)
Parameters
|
Edit this page
View Source
AddAdjacency(IList<Tile>, IList<Tile>, int, int, int)
Declares that the tiles in dest can be placed adjacent to the tiles in src, in the direction specified by (x, y, z).
(x, y, z) must be a valid direction, which usually means a unit vector.
Declaration
public void AddAdjacency(IList<Tile> src, IList<Tile> dest, int x, int y, int z)
Parameters
|
Edit this page
View Source
AddAdjacency(IList<Tile>, IList<Tile>, int, int, int, TileRotation)
Declares that the tiles in dest can be placed adjacent to the tiles in src, in the direction specified by (x, y, z).
Then it adds similar declarations for other rotations and reflections, as specified by rotations.
Declaration
public void AddAdjacency(IList<Tile> src, IList<Tile> dest, int x, int y, int z, TileRotation tileRotation = null)
Parameters
|
Edit this page
View Source
AddSample(ITopoArray<Tile>)
Declaration
public void AddSample(ITopoArray<Tile> sample)
Parameters
|
Edit this page
View Source
AddSample(ITopoArray<Tile>, TileRotation)
Declaration
public void AddSample(ITopoArray<Tile> sample, TileRotation tileRotation = null)
Parameters
|
Edit this page
View Source
Create<T>(ITopoArray<T>)
Constructs an AdjacentModel and initializees it with a given sample.
Declaration
public static AdjacentModel Create<T>(ITopoArray<T> sample)
Parameters
Returns
Type Parameters
|
Edit this page
View Source
Create<T>(T[,], bool)
Constructs an AdjacentModel and initializees it with a given sample.
Declaration
public static AdjacentModel Create<T>(T[,] sample, bool periodic)
Parameters
Type |
Name |
Description |
T[,] |
sample |
|
bool |
periodic |
|
Returns
Type Parameters
|
Edit this page
View Source
IsAdjacent(Tile, Tile, Direction)
Declaration
public bool IsAdjacent(Tile src, Tile dest, Direction d)
Parameters
Returns
|
Edit this page
View Source
MultiplyFrequency(Tile, double)
Scales the the occurency frequency of a given tile by the given multiplier.
Declaration
public override void MultiplyFrequency(Tile tile, double multiplier)
Parameters
Overrides
|
Edit this page
View Source
SetDirections(DirectionSet)
Sets the directions of the Adjacent model, if it has not been set at construction.
This specifies how many neighbours each tile has.
Once set, it cannot be changed.
Declaration
public void SetDirections(DirectionSet directions)
Parameters
|
Edit this page
View Source
SetFrequency(Tile, double)
Sets the frequency of a given tile.
Declaration
public void SetFrequency(Tile tile, double frequency)
Parameters
|
Edit this page
View Source
SetFrequency(Tile, double, TileRotation)
Finds a tile and all its rotations, and sets their total frequency.
Declaration
public void SetFrequency(Tile tile, double frequency, TileRotation tileRotation)
Parameters
|
Edit this page
View Source
Sets all tiles as equally likely to be picked
Declaration
public void SetUniformFrequency()