More resharper cleanup

This commit is contained in:
Regalis11
2015-06-07 18:03:08 +03:00
parent f786cd3016
commit 34b79c85d6
62 changed files with 99 additions and 195 deletions
@@ -1,11 +1,9 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Xml.Linq;
using FarseerPhysics;
using FarseerPhysics.Dynamics.Joints;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Subsurface.Items.Components
{
+1 -1
View File
@@ -123,7 +123,7 @@ namespace Subsurface.Items.Components
Vector2[] corners = GetConvexHullCorners(doorRect);
convexHull = new ConvexHull(corners, Color.Black);
if (window!=null && window!=Rectangle.Empty) convexHull2 = new ConvexHull(corners, Color.Black);
if (window!=Rectangle.Empty) convexHull2 = new ConvexHull(corners, Color.Black);
UpdateConvexHulls();
+2 -3
View File
@@ -1,5 +1,4 @@
using System.Diagnostics;
using System.Xml.Linq;
using System.Xml.Linq;
using FarseerPhysics;
using Microsoft.Xna.Framework;
@@ -62,7 +61,7 @@ namespace Subsurface.Items.Components
}
[HasDefaultValue(0.0f, false)]
private float HoldAngle
public float HoldAngle
{
get { return MathHelper.ToDegrees(holdAngle); }
set { holdAngle = MathHelper.ToRadians(value); }
+3 -8
View File
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Xml.Linq;
@@ -277,10 +276,10 @@ namespace Subsurface
public bool HasRequiredContainedItems(bool addMessage)
{
if (requiredItems.Count() == 0) return true;
if (!requiredItems.Any()) return true;
Item[] containedItems = item.ContainedItems;
if (containedItems == null || containedItems.Count() == 0) return false;
if (containedItems == null || !containedItems.Any()) return false;
foreach (RelatedItem ri in requiredItems)
{
@@ -298,7 +297,7 @@ namespace Subsurface
public bool HasRequiredEquippedItems(Character character, bool addMessage)
{
if (requiredItems.Count() == 0) return true;
if (!requiredItems.Any()) return true;
foreach (RelatedItem ri in requiredItems)
{
@@ -325,10 +324,6 @@ namespace Subsurface
return false;
}
}
else
{
continue;
}
}
return true;
-1
View File
@@ -1,5 +1,4 @@
using System;
using System.Diagnostics;
using System.Xml.Linq;
namespace Subsurface.Items.Components
+4 -1
View File
@@ -3,6 +3,7 @@ using System.Xml.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Globalization;
namespace Subsurface.Items.Components
{
@@ -48,7 +49,9 @@ namespace Subsurface.Items.Components
{
pt.powerLoad += (fullLoad - pt.powerLoad) / inertia;
pt.currPowerConsumption += (-fullPower - pt.currPowerConsumption) / inertia;
pt.Item.SendSignal((fullPower / Math.Max(fullLoad,1.0f)).ToString(), "power_out");
pt.Item.SendSignal(
(fullPower / Math.Max(fullLoad,1.0f)).ToString(CultureInfo.InvariantCulture),
"power_out");
}
else
+3 -10
View File
@@ -1,9 +1,4 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Specialized;
using System.Xml.Linq;
namespace Subsurface.Items.Components
@@ -29,10 +24,8 @@ namespace Subsurface.Items.Components
{
//maxFlow = ToolBox.GetAttributeFloat(element, "maxflow", 100.0f);
item.linkedTo.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(
delegate(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{ GetHulls(); }
);
item.linkedTo.CollectionChanged += delegate(object sender, NotifyCollectionChangedEventArgs e)
{ GetHulls(); };
}
public override void Update(float deltaTime, Camera cam)
+1 -1
View File
@@ -61,7 +61,7 @@ namespace Subsurface.Items.Components
}
Item[] containedItems = item.ContainedItems;
if (containedItems == null || containedItems.Count()==0) return false;
if (containedItems == null || !containedItems.Any()) return false;
foreach (Item projectile in containedItems)
{
-1
View File
@@ -5,7 +5,6 @@ using Lidgren.Network;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Subsurface.Networking;
using System.Globalization;
namespace Subsurface.Items.Components
{
+6 -3
View File
@@ -19,20 +19,23 @@ namespace Subsurface.Items.Components
float structureFixAmount, limbFixAmount;
[HasDefaultValue(100.0f, false)]
private float Range
public float Range
{
get { return ConvertUnits.ToDisplayUnits(range); }
set { range = ConvertUnits.ToSimUnits(value); }
}
[HasDefaultValue(1.0f, false)]
private float StructureFixAmount
public float StructureFixAmount
{
get { return structureFixAmount; }
set { structureFixAmount = value; }
}
[HasDefaultValue(1.0f, false)]
private float LimbFixAmount
public float LimbFixAmount
{
get { return limbFixAmount; }
set { limbFixAmount = value; }
}
+2 -2
View File
@@ -282,7 +282,7 @@ namespace Subsurface.Items.Components
isActive = true;
this.projectile = projectile;
Projectile projectileComponent = projectile.GetComponent<Projectile>();
//Projectile projectileComponent = projectile.GetComponent<Projectile>();
foreach (PhysicsBody b in ropeBodies)
{
@@ -313,7 +313,7 @@ namespace Subsurface.Items.Components
{
float rotation = (item.body.Dir == -1.0f) ? item.body.Rotation - MathHelper.Pi : item.body.Rotation;
body.SetTransform(TransformedBarrelPos, rotation);
Vector2 axis = new Vector2((float)Math.Cos(rotation), (float)Math.Sin(rotation));
//Vector2 axis = new Vector2((float)Math.Cos(rotation), (float)Math.Sin(rotation));
if (gunJoint != null) Game1.world.RemoveJoint(gunJoint);
gunJoint = new DistanceJoint(item.body.FarseerBody, body, BarrelPos,
@@ -1,5 +1,4 @@
using System;
using System.Globalization;
using System.Xml.Linq;
namespace Subsurface.Items.Components
@@ -3,7 +3,6 @@ using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace Subsurface.Items.Components
@@ -409,7 +408,7 @@ namespace Subsurface.Items.Components
{
if (wires[i] == null) continue;
Connection recipient = wires[i].OtherConnection(this);
//Connection recipient = wires[i].OtherConnection(this);
//int connectionIndex = recipient.item.Connections.FindIndex(x => x == recipient);
newElement.Add(new XElement("link",
@@ -1,9 +1,6 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace Subsurface.Items.Components
@@ -1,8 +1,4 @@
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace Subsurface.Items.Components
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.Xml.Linq;
namespace Subsurface.Items.Components
{
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.Xml.Linq;
namespace Subsurface.Items.Components
{
@@ -48,14 +48,7 @@ namespace Subsurface.Items.Components
return;
}
if (success)
{
item.SendSignal(output, "signal_out", item);
}
else
{
item.SendSignal("0", "signal_out", item);
}
item.SendSignal(success ? output : "0", "signal_out", item);
break;
case "set_output":
@@ -4,7 +4,6 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace Subsurface.Items.Components
-6
View File
@@ -1,9 +1,5 @@
using FarseerPhysics;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
namespace Subsurface.Items.Components
@@ -98,8 +94,6 @@ namespace Subsurface.Items.Components
item.Drop();
item.body.ApplyLinearImpulse(throwVector * throwForce * item.body.Mass * 3.0f);
}
return;
}
}
}
+1 -2
View File
@@ -4,7 +4,6 @@ using System.IO;
using System.Xml.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Globalization;
namespace Subsurface.Items.Components
{
@@ -152,7 +151,7 @@ namespace Subsurface.Items.Components
currPowerConsumption = powerConsumption;
float availablePower = 0.0f;
List<PowerContainer> batteries = new List<PowerContainer>();
//List<PowerContainer> batteries = new List<PowerContainer>();
foreach (MapEntity e in item.linkedTo)
{
Item battery = e as Item;
-2
View File
@@ -2,8 +2,6 @@
using System.IO;
using System.Linq;
using System.Xml.Linq;
using Microsoft.Xna.Framework;
using System.Diagnostics;
namespace Subsurface.Items.Components
{