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


C# Float3.ToDoubleArray方法代码示例

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


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

示例1: MoveTo

 void MoveTo( Float3 pos )
 {
     // check whether we really need to do anything or if order is roughly same as last one
     aicallback.DrawUnit("ARMSOLAR", pos, 0.0f, 50, aicallback.GetMyAllyTeam(), true, true);
     if( restartedfrompause || Float3Helper.GetSquaredDistance( pos, lasttargetpos ) > ( movetothreshold * movetothreshold ) )
     {
         aicallback.GiveGroupOrder( groupid, new Command( Command.CMD_MOVE, pos.ToDoubleArray() ) );
         /*
         foreach( DictionaryEntry de in UnitDefListByDeployedId )
         {
             int deployedid = (int)de.Key;
             IUnitDef unitdef = de.Value as IUnitDef;
             aicallback.GiveOrder( deployedid, new Command( Command.CMD_MOVE, pos.ToDoubleArray() ) );
         }
         */
         restartedfrompause = false;
         lasttargetpos = pos;
     }
 }
开发者ID:achoum,项目名称:spring,代码行数:19,代码来源:AttackPackCoordinatorUseGroup.cs

示例2: CommanderBuildAt

 void CommanderBuildAt( IUnitDef unitdef, Float3 buildsite )
 {
     logfile.WriteLine( "Commander building " + unitdef.name + " at " + buildsite.ToString() );
     aicallback.DrawUnit(unitdef.name, buildsite, 0.0f, 500, aicallback.GetMyAllyTeam(), true, true);
     aicallback.GiveOrder( commanderid, new Command( - unitdef.id, buildsite.ToDoubleArray() ) );
 }
开发者ID:achoum,项目名称:spring,代码行数:6,代码来源:CommanderController.cs

示例3: ExploreWith

 void ExploreWith( int unitid )
 {
     Float3 destination = new Float3();
     if( PriorityTargets.Count > 0 )
     {
         destination = PriorityTargets.Dequeue() as Float3;
         logfile.WriteLine( "dequeued next destination: " + destination.ToString() );
     }
     else
     {
         destination.x = random.Next(0, aicallback.GetMapWidth() * MovementMaps.SQUARE_SIZE );
         destination.z = random.Next( 0, aicallback.GetMapHeight() * MovementMaps.SQUARE_SIZE );
         destination.y = aicallback.GetElevation( destination.x, destination.y );
         logfile.WriteLine( "mapwidth: " + aicallback.GetMapWidth() + " squaresize: " + MovementMaps.SQUARE_SIZE );
         logfile.WriteLine( "ScoutController sending scout " + unitid + " to " + destination.ToString() );
     }
     aicallback.GiveOrder( unitid, new Command( Command.CMD_MOVE, destination.ToDoubleArray() ) );
 }
开发者ID:achoum,项目名称:spring,代码行数:18,代码来源:ScoutControllerRaider.cs

示例4: BuildAt

        void BuildAt( int constructorid, IUnitDef unitdef, Float3 buildsite )
        {
            IUnitDef placeholder;
            /*
            if( unitdef.name.ToLower() == "armmex" ) // use smaller placeholder for mexes so fit closer to intended metalspot
            {
                placeholder = buildtable.UnitDefByName[ "ARMMOHO".ToLower() ] as IUnitDef;
            }
            else
            {
                placeholder = buildtable.UnitDefByName[ "CORGANT".ToLower() ] as IUnitDef;
            }
            buildsite = aicallback.ClosestBuildSite( placeholder, buildsite, 1400.0, 2 );
            buildsite = aicallback.ClosestBuildSite( unitdef, buildsite, 1400.0, 2 );
            */
            if( unitdef.name == "ARMMEX" )
            {
                placeholder = buildtable.UnitDefByName[ "ARMMOHO".ToLower() ] as IUnitDef;
                buildsite = aicallback.ClosestBuildSite( placeholder, buildsite, 1400.0, 2 );
                buildsite = aicallback.ClosestBuildSite( unitdef, buildsite, 1400.0, 2 );
            }
            else
            {
                buildsite = BuildPlanner.GetInstance().ClosestBuildSite( unitdef, buildsite, 3000 );
                buildsite.y = aicallback.GetElevation( buildsite.x, buildsite.z );
                buildsite = aicallback.ClosestBuildSite( unitdef, buildsite, 1400, 2 );
            }

            logfile.WriteLine( "building " + unitdef.name + " at " + buildsite.ToString() );
            if( ShowNextBuildSite )
            {
                aicallback.DrawUnit(unitdef.name, buildsite, 0.0f, 500, aicallback.GetMyAllyTeam(), true, true);
            }
            aicallback.GiveOrder( constructorid, new Command( - unitdef.id, buildsite.ToDoubleArray() ) );
        }
开发者ID:achoum,项目名称:spring,代码行数:35,代码来源:ConstructorController.cs


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