Тексты программы
Файл Unit.h
#pragma once
#include <math.h>
#include <cliext/list>
#include <time.h>
#include <cliext/vector>
extern int step;
ref class point
{
public:
int x;
int y;
point(void){}
point(point %p)
{
x=p.x;
y=p.y;
}
point(point ^p)
{
x=p->x;
y=p->y;
}
point(int x1, int y1)
{
x=x1;
y=y1;
}
void init(int x1, int y1)
{
x=x1;
y=y1;
}
void init(point p)
{
x=p.x;
y=p.y;
}
bool operator == (point ^p)
{
if ((x==p->x) && (y==p->y)) return true;
else return false;
}
};
static point operator +(point ^p1, point ^p2)
{
point p3;
p3.x=(p1->x+p2->x)/2;
p3.y=(p1->y+p2->y)/2;
return p3;
}
float Length(float x, float y, point p2);
void Roundxy(int &x, int &y);
void Roundxy(point %p);
bool InSquare(int x, int y, int xs, int ys, int r);
bool pred1(point ^p1, point ^p2);
bool pred2(point ^p1, point ^p2);