本文整理汇总了C#中ICoordinates类的典型用法代码示例。如果您正苦于以下问题:C# ICoordinates类的具体用法?C# ICoordinates怎么用?C# ICoordinates使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICoordinates类属于命名空间,在下文中一共展示了ICoordinates类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: randomVectorStep
/// <summary> Рандомный шаг из данных координат
/// </summary>
/// <param name="xy"></param>
/// <returns></returns>
//-----------------------------------------------
internal static IStep randomVectorStep(ICoordinates xy)
{
Random r = new Random ();
ICoordinates t=xy;
bool found=false;
int i =-1;
while (!found) {
i = r.Next ( 3 );
switch (i) {
case 0: {
t = StepsAndCoord.Coordinates ( xy.getX () + 1,xy.getY () + 0 );
} break;
case 1: {
t = StepsAndCoord.Coordinates ( xy.getX () - 1,xy.getY () + 0 );
} break;
case 2: {
t = StepsAndCoord.Coordinates ( xy.getX () + 0,xy.getY () + 1 );
} break;
case 3: {
t = StepsAndCoord.Coordinates ( xy.getX () + 0,xy.getY () - 1 );
} break;
}
if (EpsilonBot.api.isNorm ( t )) {
found = EpsilonBot.api.getTypeOfField ( t ) != TypesOfField.WALL;
}
}
return StepsAndCoord.StepsBuilder ( t,Steps.STEP );
}
示例2: Click
/// <summary>
/// Clicks at a set of coordinates using the primary mouse button.
/// </summary>
/// <param name="where">An <see cref="ICoordinates"/> describing where to click.</param>
public void Click(ICoordinates where)
{
this.MoveIfNeeded(where);
Dictionary<string, object> parameters = new Dictionary<string, object>();
parameters.Add("button", 0);
this.driver.InternalExecute(DriverCommand.MouseClick, parameters);
}
示例3: randomVectorStep
internal static IStep randomVectorStep(ICoordinates xy)
{
Random r = new Random ();
ICoordinates t=xy;
bool found=false;
int i =-1;
while (!found) {
i = r.Next ( 3 );
switch (i) {
case 0: {
t = Helper.Coordinates ( xy.getX () + 1,xy.getY () + 0 );
found = EpsilonBot.api.isNorm ( t );
} break;
case 1: {
t = Helper.Coordinates ( xy.getX () - 1,xy.getY () + 0 );
found = EpsilonBot.api.isNorm ( t );
} break;
case 2: {
t = Helper.Coordinates ( xy.getX () + 0,xy.getY () + 1 );
found = EpsilonBot.api.isNorm ( t );
} break;
case 3: {
t = Helper.Coordinates ( xy.getX () + 0,xy.getY () - 1 );
found = EpsilonBot.api.isNorm ( t );
} break;
}
}
return Helper.StepsBuilder ( t,Steps.STEP );
}
示例4: StepsBuilder
/// <summary>/// Перегрузка конструктора CStep
/// </summary>
internal static IStep StepsBuilder(ICoordinates coord,Steps step)
{
IStep s = new CStep ();
s.setCoord ( coord );
s.setTypeOfStep (step);
return s;
}
示例5: GetSubset
/// <summary>
/// Function extracting a rectangular section of the map
/// </summary>
/// <param name="centerPoint">The point on which the section shall be centered</param>
/// <param name="subWidth">The odd numbered width of the section</param>
/// <param name="subHeight">The odd numbered height of the section</param>
/// <returns>A 2D list MapTiles</returns>
public MapTile[,] GetSubset(ICoordinates centerPoint, short subWidth, short subHeight)
{
// Check input parameters
if (null == centerPoint
|| 0 == subWidth % 2 || 0 == subHeight % 2
|| subWidth < MinimumMapSize || subHeight < MinimumMapSize
|| subHeight > Height || subWidth > Width)
return null;
// Get the number of rows / columns that there are on the side of the cell on the extract
var numberOfSideColumns = (short)Math.Truncate((float)(subWidth / 2));
var numberOfSideRows = (short) Math.Truncate((float) (subHeight/2));
// Get the top left coordinates of the extract
var smallGridMinX = centerPoint.X - numberOfSideColumns > 0 ? Convert.ToInt16(centerPoint.X - numberOfSideColumns) : (Int16)0;
var smallGridMinY = centerPoint.Y - numberOfSideRows > 0 ? Convert.ToInt16(centerPoint.Y - numberOfSideRows) : (Int16)0;
// Get the bottom right coordinates of the extract (-1 since we are working with a 0 based array)
var smallGridMaxX = smallGridMinX + subWidth >= Grid.GetLength(0) ? Convert.ToInt16(Grid.GetLength(0) - 1) : Convert.ToInt16(smallGridMinX + subWidth -1);
var smallGridMaxY = smallGridMinY + subHeight >= Grid.GetLength(1) ? Convert.ToInt16(Grid.GetLength(1) - 1) : Convert.ToInt16(smallGridMinY + subHeight -1);
MapTile[,] subArray = GetSubArray(smallGridMinX, smallGridMaxX, smallGridMinY, smallGridMaxY);
if (subArray == null)
{
}
return subArray;
}
示例6: SetDynamicElement
/// <summary>
/// Adds the color at the given coordinates to be painted during the next loop
/// </summary>
/// <param name="elementCoordinates"></param>
/// <param name="qualifier"></param>
public void SetDynamicElement(ICoordinates elementCoordinates, DisplayQualifier qualifier)
{
if (!this.UpdatedElements.ContainsKey(elementCoordinates))
this.UpdatedElements.Add(elementCoordinates, this.colorPanel.GetCorrespondingColor(qualifier));
else if (this.UpdatedElements[elementCoordinates] == this.BackgroundGrid[elementCoordinates.X, elementCoordinates.Y].GetColor())
this.UpdatedElements[elementCoordinates] = this.colorPanel.GetCorrespondingColor(qualifier);
}
示例7: Logistics
/// <summary>конструктор
/// </summary>
/// <param name="needElement">тип ячейки к которой необходимо проложить маршрут</param>
/// <param name="startPoint">отправная точка</param>
/// <param name="stepCount">максимальная удаленность объекта</param>
/// <returns></returns>
internal Logistics(ICoordinates xy,int gunTimer,int roadLen,Logistics back)
{
this.len = roadLen;
this.m_gunTimer = gunTimer;
this.m_xy = xy;
this.m_back = back;
this.mind = mind;
}
示例8: OffsetVector
/// <summary>
/// Constructor
/// </summary>
public OffsetVector(ICoordinates coordinatesFrom, ICoordinates coordinatesTo)
{
//this.X = Convert.ToInt16(coordinatesFrom.X - coordinatesTo.X);
//this.Y = Convert.ToInt16(coordinatesFrom.Y - coordinatesTo.Y);
this.X = Convert.ToInt16(coordinatesTo.X - coordinatesFrom.X);
this.Y = Convert.ToInt16(coordinatesTo.Y - coordinatesFrom.Y);
}
示例9: DistanceTo
/// <summary>
///
/// </summary>
/// <param name="position"></param>
/// <param name="coordinates"></param>
/// <returns></returns>
public Int16? DistanceTo(ICoordinates position)
{
if (position == null)
return null;
return (Int16)(Math.Abs((UInt16)(this.X - position.X)) +
Math.Abs((UInt16)(this.Y - position.Y)));
}
示例10: CGameBot
internal CGameBot(masterСhief eye, int health, int points, ICoordinates pos)
{
Eyes = eye;
Health = health;
Points = points;
TurnsToShoot = 0;
Position = pos;
TurnsToStep = 0;
}
示例11: Person
// Builder
internal Person(string name,ICoordinates xy)
{
m_name = name;
Health = HealthLast = EpsilonBot.api.myHealth ();// cHealthMax;
Money = MoneyLast = 0;
m_gun = new Gun ();
m_XY = xy;
m_wasFound = false;
}
示例12: MapSector
internal MapSector(ICoordinates mom,ICoordinates I,int roadlength)
{
i = 0;
this.mom = new ICoordinates[3];
this[i]= mom;
this.xy = I;
roadLength = roadlength;
type = TypesOfField.WALL;
}
示例13: GetClosestTrendLocationsQuery
public string GetClosestTrendLocationsQuery(ICoordinates coordinates)
{
var query = new StringBuilder(Resources.Trends_GetClosestTrendsLocations);
query.AddParameterToQuery("lat", coordinates.Latitude);
query.AddParameterToQuery("long", coordinates.Longitude);
return query.ToString();
}
示例14: Mind
//---------------------------
//Build
internal Mind(int stepLimit,ICoordinates xy)
{
i = new Person ( "Epsilon",xy );
ICoordinates unknown = Helper.Coordinates ( unknownCoord,unknownCoord );
he = new Person ( "Frag",unknown );
healthXY = new LinkedList<MapSector> ();
moneyXY = new LinkedList<MapSector> ();
hisMayBeXY = new LinkedList<MapSector> ();
this.m_stepLimit = stepLimit;
}
示例15: GenerateGeoParameter
public string GenerateGeoParameter(ICoordinates coordinates)
{
if (coordinates == null)
{
throw new ArgumentNullException("Coordinates cannot be null.");
}
string latitudeValue = coordinates.Latitude.ToString(CultureInfo.InvariantCulture);
string longitudeValue = coordinates.Longitude.ToString(CultureInfo.InvariantCulture);
return string.Format(Resources.Geo_CoordinatesParameter, longitudeValue, latitudeValue);
}