本文整理汇总了C#中TileType类的典型用法代码示例。如果您正苦于以下问题:C# TileType类的具体用法?C# TileType怎么用?C# TileType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TileType类属于命名空间,在下文中一共展示了TileType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:Czeslav,项目名称:Costam,代码行数:35,代码来源:Map.cs
示例2: BillboardPrimitive
public BillboardPrimitive(Core core, TileType tileType)
: base(core)
{
this.tileType = tileType;
BuildPrimitive();
}
开发者ID:iodiot,项目名称:Maze,代码行数:7,代码来源:BillboardPrimitive.cs
示例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;
}
开发者ID:MiloBuwalda,项目名称:ticktack,代码行数:7,代码来源:LevelLoading.cs
示例4: Tile
public Tile(TileType type, int tileID, Texture2D texture)
{
_tileType = type;
_texture = texture;
_tileName = String.Empty;
_tileID = tileID;
}
开发者ID:surfintime0027,项目名称:ArmorPotion,代码行数:7,代码来源:Tile.cs
示例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;
}
开发者ID:mikairi,项目名称:SoshiLand,代码行数:41,代码来源:PropertyTile.cs
示例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;
}
}
开发者ID:seanarooni,项目名称:Unity-common-scripts,代码行数:31,代码来源:LoadMapFromTextFile.cs
示例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;
}
开发者ID:alagalac,项目名称:MapConverter,代码行数:30,代码来源:TypeTester.cs
示例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();
}
开发者ID:buzzler,项目名称:titan,代码行数:31,代码来源:TileImporter.cs
示例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();
}
开发者ID:Foda,项目名称:Tide,代码行数:34,代码来源:Tile.xaml.cs
示例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;
}
开发者ID:kosstbarz,项目名称:Scripts,代码行数:26,代码来源:MapData.cs
示例11: TileStruct
public TileStruct(int x, int y, TileType type, TerrainType terrainType)
{
SetBoth(terrainType);
this.X = x;
this.Y = y;
this.Type = type;
}
开发者ID:Bergendahl94,项目名称:TweetnCrawl,代码行数:7,代码来源:TileStruct.cs
示例12: init
public void init(float height)
{
this.height = height;
this.heatIndex = 0;
this.type = TerrainTile.TileType.none;
this.maxHeat = 10;
}
开发者ID:AshbyGeek,项目名称:Hot-Stuff,代码行数:7,代码来源:TerrainTile.cs
示例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);
}
}
}
}
开发者ID:Sphara,项目名称:The-Lonely...-Thing,代码行数:31,代码来源:MineralFarm.cs
示例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();
}
开发者ID:au7is7icr4bbi,项目名称:Vatadoom,代码行数:12,代码来源:Tile.cs
示例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;
}
开发者ID:Nomusa,项目名称:MetroUITemplate.MvcWrapper,代码行数:31,代码来源:MetroRow.cs
示例16: HexagonTileSerializable
public HexagonTileSerializable(HexagonTile source)
{
//this.Active = source.Active;
this.X = source.Visual.X;
this.Y = source.Visual.Y;
this.TileType = source.TileType;
}
开发者ID:rfrerebe,项目名称:Three-Is-A-Crowd-Code-Compare,代码行数:7,代码来源:HexagonTileSerializable.cs
示例17: LevelTile
public LevelTile(Point twoDimPoint, TileType type, Bitmap texture)
{
dimensions = new Size(40, 38);
this.type = type;
this.twoDimPoint = twoDimPoint;
this.texture = texture;
}
开发者ID:amrufathy,项目名称:EscapeRunner,代码行数:7,代码来源:LevelTile.cs
示例18: Tool
public Tool(TileType type, Texture2D texture, bool isObstacle, int cost)
{
this.type = type;
this.texture = texture;
this.isObstacle = isObstacle;
this.cost = cost;
}
开发者ID:gogetasama,项目名称:cs134rpg,代码行数:7,代码来源:Tool.cs
示例19: Tile
public Tile(Vector2 pos, Vector2 size, TileType type, Color color)
{
position = pos;
this.size = size;
Color = color;
this.type = type;
}
开发者ID:akbiggs,项目名称:Trauma,代码行数:7,代码来源:Tile.cs
示例20: FillMap
public int[] FillMap(int size)
{
TileType[] tiles = null;
int nbTiles=0;
int[] res = null;
switch (size)
{
case 0:
nbTiles = 36;
tiles = new TileType[nbTiles];
res = new int[nbTiles];
break;
case 1:
nbTiles = 100;
tiles = new TileType[nbTiles];
res = new int[nbTiles];
break;
case 2:
nbTiles = 196;
tiles = new TileType[nbTiles];
res = new int[nbTiles];
break;
default:
System.Console.WriteLine("CE MODE N4EXISTE PAS GROS BATARD.");
break;
}
Algo_fillMap(nativeAlgo, tiles, nbTiles);
for(int i=0;i<res.Length;i++)
{
res[i] = (int)tiles[i];
}
return res;
}
开发者ID:Dduvacher,项目名称:ProjetPoo,代码行数:34,代码来源:Algo.cs
注:本文中的TileType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论