mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2026-04-06 23:03:58 +00:00
Initial commit
This commit is contained in:
parent
bc96ccb183
commit
18f89e91d4
62 changed files with 1661 additions and 2 deletions
22
vscode/Chapter06/PacktLibrary/DisplacementVector.cs
Normal file
22
vscode/Chapter06/PacktLibrary/DisplacementVector.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
namespace Packt.Shared;
|
||||
|
||||
public struct DisplacementVector
|
||||
{
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
|
||||
public DisplacementVector(int initialX, int initialY)
|
||||
{
|
||||
X = initialX;
|
||||
Y = initialY;
|
||||
}
|
||||
|
||||
public static DisplacementVector operator +(
|
||||
DisplacementVector vector1,
|
||||
DisplacementVector vector2)
|
||||
{
|
||||
return new(
|
||||
vector1.X + vector2.X,
|
||||
vector1.Y + vector2.Y);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue