当前位置: 首页>>代码示例>>C#>>正文


C# Tile.setVillage方法代码示例

本文整理汇总了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;
 }
开发者ID:hysoftwareeng,项目名称:MedievalWarfare,代码行数:22,代码来源:Village.cs

示例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 ();
 }
开发者ID:hysoftwareeng,项目名称:MedievalWarfare,代码行数:12,代码来源:Village.cs


注:本文中的Tile.setVillage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。