本文整理汇总了C#中AI.password方法的典型用法代码示例。如果您正苦于以下问题:C# AI.password方法的具体用法?C# AI.password怎么用?C# AI.password使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AI
的用法示例。
在下文中一共展示了AI.password方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main(string[] args)
{
if (args.Length == 0)
{
Bb.maxX = 5;
Bb.maxY = 5;
Point[] starts = { new Point() };
Func<Point, bool> isGoal = p => p.x == 4 && p.y == 4;
BitArray passable = new BitArray(new bool[] {
true, false, true, true, true,
true, true, true, false, true,
true, true, true, false, true,
true, false, false, false, true,
true, true, true, true, true,
});
var path = Pather.AStar(starts, isGoal, passable, (c, n) => n.x == 0 ? 1 : 0, p => 0);
foreach (Point p in path)
{
Console.WriteLine(p);
}
}
if (args.Length < 1)
{
System.Console.WriteLine("Please enter a hostname");
return;
}
IntPtr connection = Client.createConnection();
AI ai = new AI(connection);
if (Client.serverConnect(connection, args[0], "19000") == 0)
{
System.Console.WriteLine("Unable to connect to server");
return;
}
if (Client.serverLogin(connection, ai.username(), ai.password()) == 0)
return;
if (args.Length < 2)
Client.createGame(connection);
else
Client.joinGame(connection, Int32.Parse(args[1]), "player");
while (Client.networkLoop(connection) != 0)
{
if (ai.startTurn())
Client.endTurn(connection);
else
Client.getStatus(connection);
}
Client.networkLoop(connection); //Grab end game state
Client.networkLoop(connection); //Grab log
ai.end();
}
示例2: Main
public static void Main(string[] args)
{
if(args.Length < 1)
{
System.Console.WriteLine("Please enter a hostname");
return;
}
IntPtr connection = Client.createConnection();
AI ai = new AI(connection);
if((Client.serverConnect(connection, args[0], "19000")) == 0)
{
System.Console.WriteLine("Unable to connect to server");
return;
}
if((Client.serverLogin(connection, ai.username(), ai.password())) == 0)
{
return;
}
if(args.Length < 2)
{
Client.createGame(connection);
}
else
{
Client.joinGame(connection, Int32.Parse(args[1]));
}
while(Client.networkLoop(connection) != 0)
{
if(ai.startTurn())
{
Client.endTurn(connection);
}
else
{
Client.getStatus(connection);
}
}
Client.networkLoop(connection); //Grab end game state
Client.networkLoop(connection); //Grab log
ai.end();
return;
}
示例3: Main
public static void Main(string[] args)
{
if (args.Length < 1)
{
System.Console.WriteLine("Please enter a hostname");
Bb.Width = 5;
Bb.Height = 5;
var passable = new BitArray(new bool[] {
true, false, true, true, true,
true, false, true, true, true,
true, false, false, false, true,
true, false, true, true, true,
true, true, true, true, true
});
var start = new Point(0, 0);
var goal = new Point(2, 0);
var path = Pather.AStar(
new[] { start },
passable.ToFunc(),
p => p.Equals(goal),
(p1, p2) => p2.y == 0 ? 10 : 1,
p => 0);
path.ForEach(p => Console.WriteLine(p));
Console.WriteLine("Done");
return;
}
IntPtr connection = Client.createConnection();
AI ai = new AI(connection);
if (Client.serverConnect(connection, args[0], "19000") == 0)
{
System.Console.WriteLine("Unable to connect to server");
return;
}
if (Client.serverLogin(connection, ai.username(), ai.password()) == 0)
return;
if (args.Length < 2)
Client.createGame(connection);
else
Client.joinGame(connection, Int32.Parse(args[1]), "player");
while (Client.networkLoop(connection) != 0)
{
if (ai.startTurn())
Client.endTurn(connection);
else
Client.getStatus(connection);
}
Client.networkLoop(connection); //Grab end game state
Client.networkLoop(connection); //Grab log
ai.end();
}