• Create Account

We're offering banner ads on our site from just \$5!

### #ActualMichael Tanczos

Posted 28 December 2012 - 12:09 AM

public class MyVector
{
public int X { get; set; }
public int Y { get; set; }
}

class Program
{
public static T AddVector<T>(T a, T b)
where T : MyVector, new()
{
T newVector = new T();
newVector.X = a.X + b.X;
newVector.Y = a.Y + b.Y;

return newVector;
}

static void Main(string[] args)
{
MyVector a = new MyVector();
a.X = 1;
a.Y = 2;
MyVector b = new MyVector();
b.X = 10;
b.Y = 11;
Console.WriteLine(c.X + ", " + c.Y);
}
}


Code here..

const int map_width = 20, map_height = 20;
int[,] map = new int[map_width, map_height];

string path = Path.Combine(StorageContainer.TitleLocation, "Content\\map.txt");
{
int y = 0;
{
// get a line

// split at the equals sign
string[] parts = line.Split(',');

for (int x = 0; x < parts.length; x++)
{
map[x,y] = Convert.ToInt32(parts[x]);
}

y++;
}
}



### #1Michael Tanczos

Posted 28 December 2012 - 12:05 AM

public class MyVector
{
public int X { get; set; }
public int Y { get; set; }
}

class Program
{
public static T AddVector<T>(T a, T b)
where T : MyVector, new()
{
T newVector = new T();
newVector.X = a.X + b.X;
newVector.Y = a.Y + b.Y;

return newVector;
}

static void Main(string[] args)
{
MyVector a = new MyVector();
a.X = 1;
a.Y = 2;
MyVector b = new MyVector();
b.X = 10;
b.Y = 11;
Console.WriteLine(c.X + ", " + c.Y);
}
}


Code here..

const int map_width = 20, map_height = 20;
int[,] map = new int[map_width, map_height];

string path = Path.Combine(StorageContainer.TitleLocation, "Content\\map.txt");
{
int y = 0;
{
// get a line

// split at the equals sign
string[] parts = line.Split(',');

for (int x = 0; x < parts.length; x++)
{
map[x,y] = Convert.ToInt32(parts[x]);
}

y++;
}
}



PARTNERS