本文整理汇总了C#中Tile.setVillage方法的典型用法代码示例。如果您正苦于以下问题:C# Tile.setVillage方法的具体用法?C# Tile.setVillage怎么用?C# Tile.setVillage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tile
的用法示例。
在下文中一共展示了Tile.setVillage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateComponent
//constructor
public static Village CreateComponent( Player p, List<Tile> regions, Tile locatedAt, GameObject villagePrefab )
{
Debug.Log ("-----Village.CreateComponent() CALLED--------");
Village myVillage = villagePrefab.AddComponent<Village>();
myVillage.controlledRegion = regions;//todo
myVillage.controlledBy = p;//TODO: Currently set in Mapgenerator
myVillage.myType = VillageType.Hovel;
myVillage.supportedUnits = new List<Unit> ();
locatedAt.replace (villagePrefab);//to check : Set in Mapgenerator
myVillage.locatedAt = locatedAt;//done
locatedAt.setVillage (myVillage);//done
myVillage.myAction = VillageActionType.ReadyForOrders;
myVillage.gold = 0;
myVillage.wood = 0;
//TODO: set controlledRegions in tiles : Call updateControlledRegionNet()
foreach (Tile t in myVillage.controlledRegion)
{
t.setVillage(myVillage);
}
return myVillage;
}
示例2: addTile
/*
* Function adds t to village region and colors.
* this function does NOT remove the tile from the old village.
*/
public void addTile(Tile t)
{
controlledRegion.Add(t);
t.setVillage(this);
int color = this.getPlayer ().getColor ();
t.setColor( color );
t.colorTile ();
}