1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

#18051: Remove redundant casts and 'using', 'else', 'this' statements

This commit is contained in:
Xavier Cho
2018-04-08 12:28:24 +09:00
parent 9e2e6bb1e2
commit 0ef3e0577b
19 changed files with 211 additions and 281 deletions

View File

@@ -1,6 +1,5 @@
using System;
using System.Runtime.InteropServices;
#if REAL_T_IS_DOUBLE
using real_t = System.Double;
#else
@@ -269,22 +268,22 @@ namespace Godot
// Constructors
public Transform2D(Vector2 xAxis, Vector2 yAxis, Vector2 origin)
{
this.x = xAxis;
this.y = yAxis;
this.o = origin;
x = xAxis;
y = yAxis;
o = origin;
}
public Transform2D(real_t xx, real_t xy, real_t yx, real_t yy, real_t ox, real_t oy)
{
this.x = new Vector2(xx, xy);
this.y = new Vector2(yx, yy);
this.o = new Vector2(ox, oy);
x = new Vector2(xx, xy);
y = new Vector2(yx, yy);
o = new Vector2(ox, oy);
}
public Transform2D(real_t rot, Vector2 pos)
{
real_t cr = Mathf.Cos( (real_t)rot);
real_t sr = Mathf.Sin( (real_t)rot);
real_t cr = Mathf.Cos(rot);
real_t sr = Mathf.Sin(rot);
x.x = cr;
y.y = cr;
x.y = -sr;
@@ -345,9 +344,9 @@ namespace Godot
{
return String.Format("({0}, {1}, {2})", new object[]
{
this.x.ToString(),
this.y.ToString(),
this.o.ToString()
x.ToString(),
y.ToString(),
o.ToString()
});
}
@@ -355,9 +354,9 @@ namespace Godot
{
return String.Format("({0}, {1}, {2})", new object[]
{
this.x.ToString(format),
this.y.ToString(format),
this.o.ToString(format)
x.ToString(format),
y.ToString(format),
o.ToString(format)
});
}
}