ReSharper redundant code cleanup

This commit is contained in:
Lucas Nicodemus 2011-12-30 14:32:05 -07:00
parent fd51214146
commit 1147788154
21 changed files with 148 additions and 150 deletions

View file

@ -15,13 +15,12 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using Terraria;
using TShockAPI.Net;
namespace TShockAPI
@ -60,21 +59,21 @@ namespace TShockAPI
public int UserID = -1;
public bool HasBeenNaggedAboutLoggingIn;
public bool TPAllow = true;
public bool mute = false;
public bool TpLock = false;
public bool mute;
public bool TpLock;
Player FakePlayer;
public bool RequestedSection = false;
public bool RequestedSection;
public DateTime LastDeath { get; set; }
public bool Dead = false;
public bool Dead;
public string Country = "??";
public int Difficulty;
private string CacheIP;
public string IgnoreActionsForInventory = "none";
public string IgnoreActionsForCheating = "none";
public string IgnoreActionsForDisabledArmor = "none";
public bool IgnoreActionsForClearingTrashCan = false;
public bool IgnoreActionsForClearingTrashCan;
public PlayerData PlayerData;
public bool RequiresPassword = false;
public bool RequiresPassword;
public bool RealPlayer
{
@ -266,8 +265,8 @@ namespace TShockAPI
{
using (var ms = new MemoryStream())
{
var msg = new SpawnMsg()
{
var msg = new SpawnMsg
{
PlayerIndex = (byte)Index,
TileX = tilex,
TileY = tiley
@ -281,8 +280,8 @@ namespace TShockAPI
{
using (var ms = new MemoryStream())
{
var msg = new ProjectileRemoveMsg()
{
var msg = new ProjectileRemoveMsg
{
Index = (short)index,
Owner = (byte)owner
};
@ -296,7 +295,7 @@ namespace TShockAPI
try
{
int num = (size - 1) / 2;
SendData(PacketTypes.TileSendSquare, "", size, (float)(x - num), (float)(y - num));
SendData(PacketTypes.TileSendSquare, "", size, (x - num), (y - num));
return true;
}
catch (Exception ex)
@ -372,7 +371,7 @@ namespace TShockAPI
if ((DateTime.UtcNow - LastThreat).TotalMilliseconds < 5000 && !bypass)
return;
SendData(PacketTypes.PlayerAddBuff, number: Index, number2: (float)type, number3: (float)time);
SendData(PacketTypes.PlayerAddBuff, number: Index, number2: type, number3: time);
}
//Todo: Separate this into a few functions. SendTo, SendToAll, etc
@ -476,7 +475,7 @@ namespace TShockAPI
public NetItem[] inventory = new NetItem[NetItem.maxNetInventory];
public int maxHealth = 100;
//public int maxMana = 100;
public bool exists = false;
public bool exists;
public PlayerData(TSPlayer player)
{
@ -571,14 +570,14 @@ namespace TShockAPI
public class NetItem
{
public static int maxNetInventory = 59;
public int netID = 0;
public int stack = 0;
public int prefix = 0;
public int netID;
public int stack;
public int prefix;
public static string ToString(NetItem[] inventory)
{
string inventoryString = "";
for (int i = 0; i < NetItem.maxNetInventory; i++)
for (int i = 0; i < maxNetInventory; i++)
{
if (i != 0)
inventoryString += "~";
@ -598,9 +597,9 @@ namespace TShockAPI
public static NetItem[] Parse(string data)
{
NetItem[] inventory = new NetItem[NetItem.maxNetInventory];
NetItem[] inventory = new NetItem[maxNetInventory];
int i;
for (i = 0; i < NetItem.maxNetInventory; i++)
for (i = 0; i < maxNetInventory; i++)
{
inventory[i] = new NetItem();
}