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


C# Village.getAction方法代码示例

本文整理汇总了C#中Village.getAction方法的典型用法代码示例。如果您正苦于以下问题:C# Village.getAction方法的具体用法?C# Village.getAction怎么用?C# Village.getAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Village的用法示例。


在下文中一共展示了Village.getAction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: buildCastle

 public void buildCastle(Village v)
 {
     int vWood = v.getWood ();
     VillageType vType = v.getMyType ();
     VillageActionType vAction = v.getAction ();
     if (vType != VillageType.Fort) {
         gameGUI.displayError (@"Upgrade to a Fort before building a Castle");
     } else if (vWood < 12) {
         gameGUI.displayError (@"Castles require more lumber (12)");
     } else if (vAction != VillageActionType.ReadyForOrders) {
         gameGUI.displayError (@"You cant queue build orders :/");
     } else {
         v.setAction(VillageActionType.StartedUpgrading);
         v.addWood (-12);
     }
 }
开发者ID:hysoftwareeng,项目名称:MedievalWarfare,代码行数:16,代码来源:VillageManager.cs

示例2: upgradeVillage

 public void upgradeVillage(Village v)
 {
     int vWood = v.getWood ();
     VillageType vType = v.getMyType ();
     VillageActionType vAction = v.getAction ();
     if (vType == VillageType.Fort)
     {
         gameGUI.displayError(@"The only structure stronger than a Fort is a Castle. ¯\(°_o)/¯ Press Build Castle to go to the next level!");
     }
     else if ((vType != VillageType.Fort) && (vWood >= 8) && (vAction == VillageActionType.ReadyForOrders))
     {
         //v.setAction (VillageActionType.StartedUpgrading);
         v.networkView.RPC ("setVillageActionNet",RPCMode.AllBuffered,(int)VillageActionType.StartedUpgrading);
         //v.addWood(-8);
         v.networkView.RPC("addWoodNet",RPCMode.AllBuffered,-8);
     }
 }
开发者ID:hysoftwareeng,项目名称:MedievalWarfare,代码行数:17,代码来源:VillageManager.cs

示例3: updateVillageActions

 public void updateVillageActions(Village v)
 {
     VillageActionType action = v.getAction ();
     if (action == VillageActionType.StartedUpgrading)
     {
         v.gameObject.networkView.RPC ("setVillageActionNet",RPCMode.AllBuffered,(int)VillageActionType.FinishedUpgrading);
     }
     else if (action == VillageActionType.FinishedUpgrading)
     {
         v.gameObject.networkView.RPC ("setVillageActionNet",RPCMode.AllBuffered,(int)VillageActionType.ReadyForOrders);
         VillageType vType = v.getMyType();
         if (vType == VillageType.Hovel)
         {
             v.gameObject.networkView.RPC ("switchPrefabNet",RPCMode.AllBuffered,(int)VillageType.Town);
             v.gameObject.networkView.RPC ("setVillageTypeNet",RPCMode.AllBuffered,(int)VillageType.Town);
             v.gameObject.networkView.RPC ("setHealthNet",RPCMode.AllBuffered,2);
         }
         else if (vType == VillageType.Town)
         {
             v.gameObject.networkView.RPC ("switchPrefabNet",RPCMode.AllBuffered,(int)VillageType.Fort);
             v.gameObject.networkView.RPC ("setVillageTypeNet",RPCMode.AllBuffered,(int)VillageType.Fort);
             v.gameObject.networkView.RPC ("setHealthNet",RPCMode.AllBuffered,5);
         }
         else if (vType == VillageType.Fort)
         {
             v.gameObject.networkView.RPC ("switchPrefabNet",RPCMode.AllBuffered,(int)VillageType.Castle);
             v.gameObject.networkView.RPC ("setVillageTypeNet",RPCMode.AllBuffered,(int)VillageType.Castle);
             v.gameObject.networkView.RPC ("setHealthNet",RPCMode.AllBuffered,10);
             v.gameObject.networkView.RPC ("setWageNet",RPCMode.AllBuffered,80);
         }
     }
 }
开发者ID:hysoftwareeng,项目名称:MedievalWarfare,代码行数:32,代码来源:VillageManager.cs


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