本文整理汇总了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;
}
}
示例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() ) );
}
示例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() ) );
}
示例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() ) );
}