本文整理汇总了C#中TileType类的典型用法代码示例。如果您正苦于以下问题:C# TileType类的具体用法?C# TileType怎么用?C# TileType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TileType类属于命名空间,在下文中一共展示了TileType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateTile
private void CreateTile(TileType type, Vector2 position)
{
//sets tile with given position to given type
if (position.X > mapSize
|| position.Y > mapSize)
{
return;
}
Tile til;
switch (type)
{
case TileType.Grass:
til = new TileGrass(position);
break;
case TileType.Rock:
til = new TileRock(position);
break;
case TileType.Gravel:
til = new TileGravel(position);
break;
case TileType.Water:
til = new TileWater(position);
break;
default:
til = new TileGrass(position);
break;
}
int X = (int)position.X;
int Y = (int)position.Y;
TilesArray[X, Y] = til;
}
示例2: BillboardPrimitive
public BillboardPrimitive(Core core, TileType tileType)
: base(core)
{
this.tileType = tileType;
BuildPrimitive();
}
示例3: LoadBasicTile
private Tile LoadBasicTile(string name, TileType tileType, bool hot = false, bool ice = false)
{
Tile t = new Tile("Tiles/" + name, tileType);
t.Hot = hot;
t.Ice = ice;
return t;
}
示例4: Tile
public Tile(TileType type, int tileID, Texture2D texture)
{
_tileType = type;
_texture = texture;
_tileName = String.Empty;
_tileID = tileID;
}
示例5: PropertyTile
private int propertyPrice = 0; // Cost to initially purchase property
#endregion Fields
#region Constructors
public PropertyTile(
TileType t,
string n,
Color c,
int bR,
int h1R,
int h2R,
int h3R,
int h4R,
int hR,
int mV,
int hC,
int hotelC,
int pP)
: base(n, t)
{
// Set all the property values
// These are meant to be static, so they shouldn't change
houseRent = new int[4];
color = c;
baseRent = bR;
houseRent[0] = h1R;
houseRent[1] = h2R;
houseRent[2] = h3R;
houseRent[3] = h4R;
hotelRent = hR;
mortgageValue = mV;
houseCost = hC;
hotelCost = hotelC;
propertyPrice = pP;
currentRentCost = baseRent;
}
示例6: Read
public TileType[,] Read(TextAsset file, int xSize, int ySize)
{
StringReader reader = new StringReader(file.text);
TileType[,] ttmap = new TileType[xSize, ySize];
if (reader == null)
{
print ("read failed");
return null;
}
else
{
int x = 0;
int y = ySize - 1;
for (string line = reader.ReadLine(); line != null; line = reader.ReadLine())
{
//PrintMapLine(line, row);
x = 0;
foreach(char c in line)
{
//print ("" + x + " " + y);
ttmap[x,y] = ConvertToTileTypeFromChar(c, x, y);
x++;
}
y--;
}
return ttmap;
}
}
示例7: IsTileAngle
public bool IsTileAngle()
{
var mid = Elevations[4];
if (Elevations[0] < mid)
{
this.Type = TileType.TopLeftAngle;
return true;
}
if (Elevations[2] < mid)
{
this.Type = TileType.TopRightAngle;
return true;
}
if (Elevations[6] < mid)
{
this.Type = TileType.BottomLeftAngle;
return true;
}
if (Elevations[8] < mid)
{
this.Type = TileType.BottomRightAngle;
return true;
}
return false;
}
示例8: DrawPreview
/// <summary>
/// Draws the preview.
/// </summary>
void DrawPreview()
{
GUILayout.Label("Preview", EditorStyles.boldLabel);
GUILayout.BeginHorizontal();
GUILayout.BeginVertical();
EditorGUILayout.Separator();
EditorGUILayout.TextField(AssetDatabase.GetAssetPath(selected));
TileType tempType = ttype;
ttype = (TileType) EditorGUILayout.EnumPopup("Base Frame", ttype);
if (ttype != tempType)
OnSelectionChange();
int tempInt = pivotX;
pivotX = EditorGUILayout.IntField("Pivot X", pivotX);
if (pivotX != tempInt)
OnSelectionChange();
tempInt = pivotY;
pivotY = EditorGUILayout.IntField("Pivot Y", pivotY);
if (pivotY != tempInt)
OnSelectionChange();
EditorGUILayout.Popup(0, new string[] {"New Category", "Brick"});
categoryName = EditorGUILayout.TextField("Category Name", categoryName);
if (GUILayout.Button("add to library")) {
OnClickAdd();
}
GUILayout.EndVertical();
GUILayout.Box(mixed);
GUILayout.EndHorizontal();
}
示例9: Tile
public Tile(String title, Color c, String path, bool pinned)
{
InitializeComponent();
TileTitle = title;
l_LabelTile.Content = TileTitle;
SolidColorBrush scb = new SolidColorBrush(c);
r_TileRect.Fill = scb;
r_Fx.Color = c;
s_AppPath = path;
//Pinned state
b_isPinned = pinned;
if (b_isPinned == true)
cm_Pin.Header = "Unpin";
tt_Type = TileType.Application;
this.DataContext = this;
api_Email = new APIGmHelper("", "");
//"\\Images\\Icons\\"
String exeName = path;
int start = exeName.LastIndexOf("\\");
exeName = exeName.Substring(start + 1, exeName.Length - start - 5);
exeName = exeName.ToLower();
BitmapImage img = new BitmapImage(new Uri("..\\Images\\AppIcons\\" + exeName + ".png", UriKind.Relative));
i_Icon.Source = img;
//(BitmapSource)Helpers.GetIcon(s_AppPath, false, false);
InitAnimations();
}
示例10: FillTileTypes
// TODO Make reading of types from file
void FillTileTypes()
{
tileTypes = new TileType[7];
TileType grass = new TileType(Types.Grassland, true, 1);
TileType road = new TileType(Types.Road, true, 2);
TileType mountain = new TileType(Types.Mountain, false, 1);
TileType water = new TileType(Types.Water, false, 1);
TileType swamp = new TileType(Types.Swamp, true, 0.5f);
TileType unknown = new TileType(Types.Unknown, true, 1);
TileType house = new TileType(Types.House, false, 1);
tileTypes[0] = grass;
tileTypes[1] = road;
tileTypes[2] = mountain;
tileTypes[3] = water;
tileTypes[4] = swamp;
tileTypes[5] = unknown;
tileTypes[6] = house;
}
示例11: TileStruct
public TileStruct(int x, int y, TileType type, TerrainType terrainType)
{
SetBoth(terrainType);
this.X = x;
this.Y = y;
this.Type = type;
}
示例12: init
public void init(float height)
{
this.height = height;
this.heatIndex = 0;
this.type = TerrainTile.TileType.none;
this.maxHeat = 10;
}
示例13: GrowAll
/// <summary>
/// Grows the minerals on the map.
/// </summary>
/// <param name="map">The map where the minerals spawn</param>
/// <param name="biomeMap">The biome map attached to the previous map.</param>
public void GrowAll (TileType[, ] map, BiomeType[, ] biomeMap) {
NoiseGenerator gen = new NoiseGenerator ();
while (availableMinerals.Count > 0) {
MineralInfo mineral = availableMinerals.Dequeue();
gen.Reset();
for (int x = 0; x < map.GetLength(0); x ++) {
int y = (mineral.minHeight > 0 ? mineral.minHeight : 0);
int maxY = (mineral.maxHeight < map.GetLength(1) ? mineral.maxHeight : map.GetLength(1));
for (; y < maxY; y ++) {
if (IsTileCompatible(biomeMap, x, y, mineral.compatibleBiomes) && (mineral.rarity < (int) gen.PerlinNoise(x, y, 10, 100, 1)))
PlaceMinerals(map, x, y, mineral.minerals);
}
}
}
}
示例14: Tile
/// <summary>
/// Create an invisible tile. Useful for the spawn tile or waypoint tiles
/// </summary>
/// <param name="position">The tile's world coordinates</param>
/// <param name="type">The tile type, determined when it is initially read in</param>
public Tile(Vector2 position, TileType type, float depth)
{
texture = null;
BoundingRectangle = new BoundingBox(new Vector3(position.X, position.Y, depth), new Vector3(position.X + 60, position.Y + 40, depth));
tileType = type;
setCollisions();
}
示例15: AddTile
// Create a new tile for this row using common base
public MetroTile AddTile(TileType type, TileWidth width, TileHeight height, string bgColor, string title, string onClick = "", string navUrl = "")
{
// Get the last tile added to this row
MetroTile lastTileAdded = this.Tiles.LastOrDefault();
int nextLeftMargin = 0;
// If this is the first tile in the row, margin is column margin
if (lastTileAdded == null)
{
nextLeftMargin = this.Column.LeftMargin;
}
else
{
// Calculate left margin based on the previous tile in the row
nextLeftMargin = lastTileAdded.LeftMargin + lastTileAdded.Width + Column.SpacingBetweenTiles;
}
// Now create the actual tile based on our calculations
MetroTile newTile = new MetroTile(this.Column.Position, type, TopMargin, nextLeftMargin, width, height, bgColor, title, onClick, navUrl);
// Add the new tile to the list of tiles for this row
this.Tiles.Add(newTile);
// Recalculate the width and height of this row
this.Width = this.Width == 0 ? newTile.Width : this.Width + Column.SpacingBetweenTiles + newTile.Width;
this.Height = this.Height < newTile.Height ? newTile.Height : this.Height;
// Return the new tile so it can be further worked with
return newTile;
}