コード例 #1
0
ファイル: Vector2D.cs プロジェクト: stetar/Threading
 public Vector2D Subtract(Vector2D vec)
 {
     Vector2D newVec = new Vector2D(x, y);
     newVec.X = vec.X - this.x;
     newVec.Y = vec.Y - this.y;
     return newVec;
 }
コード例 #2
0
ファイル: Worker.cs プロジェクト: stetar/Threading
 //The constructor. This also creates the string, which make the worker travel between the inn and the farm.
 public Worker(float speed, string imagepath, Vector2D startPos, float scalefactor) : base(imagepath, startPos, scalefactor)
 {
     this.speed = speed;
     Thread t = new Thread(() => Update(GameWorld.currentFps));
     t.IsBackground = true;
     t.Start();
 }
コード例 #3
0
ファイル: GameObject.cs プロジェクト: stetar/Threading
 //The base constructor.
 public GameObject(string imagePath, Vector2D startPos, float scaleFactor)
 {
     position = startPos;
     this.scaleFactor = scaleFactor;
     this.imagePath = imagePath;
     this.sprite = Image.FromFile(imagePath);
 }
コード例 #4
0
ファイル: Farm.cs プロジェクト: stetar/Threading
 public Farm(string imagepath, Vector2D startpos, float scalefactor) : base(imagepath, startpos, scalefactor)
 {
     base.position = startpos;
 }