Clean up some warnings (#6088)

* Clean up some warnings

* Remove nullable enable

Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>

Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
This commit is contained in:
wrexbe
2022-01-09 20:10:36 -08:00
committed by GitHub
parent 03c56bf23e
commit 5ceb2372bf
37 changed files with 126 additions and 119 deletions

View File

@@ -46,7 +46,7 @@ namespace Content.Client.Arcade.UI
_menu?.SetUsability(userMessage.IsPlayer);
break;
case BlockGameMessages.BlockGameSetScreenMessage statusMessage:
if (statusMessage.isStarted) _menu?.SetStarted();
if (statusMessage.IsStarted) _menu?.SetStarted();
_menu?.SetScreen(statusMessage.Screen);
if (statusMessage is BlockGameMessages.BlockGameGameOverScreenMessage gameOverScreenMessage)
_menu?.SetGameoverInfo(gameOverScreenMessage.FinalScore, gameOverScreenMessage.LocalPlacement, gameOverScreenMessage.GlobalPlacement);

View File

@@ -9,16 +9,16 @@ namespace Content.Client.Computer
/// ComputerBoundUserInterface shunts all sorts of responsibilities that are in the BoundUserInterface for architectural reasons into the Window.
/// NOTE: Despite the name, ComputerBoundUserInterface does not and will not care about things like power.
/// </summary>
public class ComputerBoundUserInterface<W, S> : ComputerBoundUserInterfaceBase where W : BaseWindow, IComputerWindow<S>, new() where S : BoundUserInterfaceState
public class ComputerBoundUserInterface<TWindow, TState> : ComputerBoundUserInterfaceBase where TWindow : BaseWindow, IComputerWindow<TState>, new() where TState : BoundUserInterfaceState
{
[Dependency] private readonly IDynamicTypeFactory _dynamicTypeFactory = default!;
private W? _window;
private TWindow? _window;
protected override void Open()
{
base.Open();
_window = (W) _dynamicTypeFactory.CreateInstance(typeof(W));
_window = (TWindow) _dynamicTypeFactory.CreateInstance(typeof(TWindow));
_window.SetupComputerWindow(this);
_window.OnClose += Close;
_window.OpenCentered();
@@ -36,7 +36,7 @@ namespace Content.Client.Computer
return;
}
_window.UpdateState((S) state);
_window.UpdateState((TState) state);
}
protected override void Dispose(bool disposing)
@@ -64,10 +64,10 @@ namespace Content.Client.Computer
}
}
public interface IComputerWindow<S>
public interface IComputerWindow<TState>
{
void SetupComputerWindow(ComputerBoundUserInterfaceBase cb) {}
void UpdateState(S state) {}
void UpdateState(TState state) {}
}
}

View File

@@ -4,10 +4,8 @@ using Robust.Client.Graphics;
using Robust.Client.Utility;
using Robust.Shared.Enums;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using Robust.Shared.Maths;
namespace Content.Client.Decals
{

View File

@@ -28,7 +28,7 @@ namespace Content.Client.Inventory
{
base.Open();
_strippingMenu = new StrippingMenu($"{Loc.GetString("strippable-bound-user-interface-stripping-menu-title",("ownerName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Owner).EntityName))}");
_strippingMenu = new StrippingMenu($"{Loc.GetString("strippable-bound-user-interface-stripping-menu-title",("ownerName", IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Owner).EntityName))}");
_strippingMenu.OnClose += Close;
_strippingMenu.OpenCentered();

View File

@@ -20,9 +20,9 @@ namespace Content.Client.Lathe.Components
Clear();
foreach (var ID in state.Recipes)
foreach (var id in state.Recipes)
{
if (!_prototypeManager.TryIndex(ID, out LatheRecipePrototype? recipe)) continue;
if (!_prototypeManager.TryIndex(id, out LatheRecipePrototype? recipe)) continue;
AddRecipe(recipe);
}
}

View File

@@ -26,9 +26,9 @@ namespace Content.Client.Lathe.Components
Clear();
foreach (var ID in state.Recipes)
foreach (var id in state.Recipes)
{
if(!_prototypeManager.TryIndex(ID, out LatheRecipePrototype? recipe)) continue;
if(!_prototypeManager.TryIndex(id, out LatheRecipePrototype? recipe)) continue;
AddRecipe(recipe);
}

View File

@@ -36,7 +36,7 @@ namespace Content.Client.MedicalScanner.UI
}
else
{
text.Append($"{Loc.GetString("medical-scanner-window-entity-health-text", ("entityName", Name: entities.GetComponent<MetaDataComponent>(state.Entity.Value).EntityName))}\n");
text.Append($"{Loc.GetString("medical-scanner-window-entity-health-text", ("entityName", entities.GetComponent<MetaDataComponent>(state.Entity.Value).EntityName))}\n");
var totalDamage = state.DamagePerType.Values.Sum();

View File

@@ -1,4 +1,4 @@
using Content.Client.VendingMachines.UI;
using Content.Client.VendingMachines.UI;
using Content.Shared.VendingMachines;
using Robust.Client.GameObjects;
using Robust.Shared.GameObjects;
@@ -38,9 +38,9 @@ namespace Content.Client.VendingMachines
_menu.OpenCentered();
}
public void Eject(string ID)
public void Eject(string id)
{
SendMessage(new VendingMachineEjectMessage(ID));
SendMessage(new VendingMachineEjectMessage(id));
}
protected override void ReceiveMessage(BoundUserInterfaceMessage message)

View File

@@ -64,7 +64,6 @@ namespace Content.IntegrationTests.Tests
EntityUid uniform = default;
EntityUid idCard = default;
EntityUid pocketItem = default;
InventoryComponent inventory = null;
InventorySystem invSystem = default!;

View File

@@ -1,4 +1,4 @@
using System.Linq.Expressions;
using System.Linq.Expressions;
using System.Net;
using System.Reflection;
using Microsoft.EntityFrameworkCore.Storage;
@@ -42,26 +42,27 @@ namespace Content.Server.Database
}
protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters parameters)
=> new NpgsqlInetWithMaskTypeMapping(parameters);
{
return new NpgsqlInetWithMaskTypeMapping(parameters);
}
protected override string GenerateNonNullSqlLiteral(object value)
{
var cidr = ((IPAddress Address, int Subnet)) value;
return $"INET '{cidr.Address}/{cidr.Subnet}'";
var (address, subnet) = ((IPAddress, int)) value;
return $"INET '{address}/{subnet}'";
}
public override Expression GenerateCodeLiteral(object value)
{
var cidr = ((IPAddress Address, int Subnet)) value;
var (address, subnet) = ((IPAddress, int)) value;
return Expression.New(
Constructor,
Expression.Call(ParseMethod, Expression.Constant(cidr.Address.ToString())),
Expression.Constant(cidr.Subnet));
Expression.Call(ParseMethod, Expression.Constant(address.ToString())),
Expression.Constant(subnet));
}
static readonly MethodInfo ParseMethod = typeof(IPAddress).GetMethod("Parse", new[] {typeof(string)})!;
static readonly ConstructorInfo Constructor =
private static readonly MethodInfo ParseMethod = typeof(IPAddress).GetMethod("Parse", new[] {typeof(string)})!;
private static readonly ConstructorInfo Constructor =
typeof((IPAddress, int)).GetConstructor(new[] {typeof(IPAddress), typeof(int)})!;
}
}

View File

@@ -21,7 +21,9 @@ namespace Content.Server.Database
}
public void ApplyServices(IServiceCollection services)
=> services.AddSnakeCase();
{
services.AddSnakeCase();
}
public void Validate(IDbContextOptions options) {}
@@ -33,7 +35,10 @@ namespace Content.Server.Database
public override string LogFragment => "Snake Case Extension";
public override int GetServiceProviderHashCode() => 0;
public override int GetServiceProviderHashCode()
{
return 0;
}
public override bool ShouldUseSameServiceProvider(DbContextOptionsExtensionInfo other)
{
@@ -154,7 +159,9 @@ namespace Content.Server.Database
public virtual void ProcessPropertyAdded(
IConventionPropertyBuilder propertyBuilder,
IConventionContext<IConventionPropertyBuilder> context)
=> RewriteColumnName(propertyBuilder);
{
RewriteColumnName(propertyBuilder);
}
public void ProcessForeignKeyOwnershipChanged(IConventionForeignKeyBuilder relationshipBuilder, IConventionContext<bool?> context)
{
@@ -237,7 +244,9 @@ namespace Content.Server.Database
public void ProcessForeignKeyAdded(
IConventionForeignKeyBuilder relationshipBuilder,
IConventionContext<IConventionForeignKeyBuilder> context)
=> relationshipBuilder.HasConstraintName(RewriteName(relationshipBuilder.Metadata.GetDefaultName()));
{
relationshipBuilder.HasConstraintName(RewriteName(relationshipBuilder.Metadata.GetDefaultName()));
}
public void ProcessKeyAdded(IConventionKeyBuilder keyBuilder, IConventionContext<IConventionKeyBuilder> context)
{
@@ -289,7 +298,7 @@ namespace Content.Server.Database
}
}
private void RewriteColumnName(IConventionPropertyBuilder propertyBuilder)
private static void RewriteColumnName(IConventionPropertyBuilder propertyBuilder)
{
var property = propertyBuilder.Metadata;
var entityType = property.DeclaringEntityType;

View File

@@ -81,10 +81,10 @@ namespace Content.Server.AI.Pathfinding
}
}
public bool InBounds(Vector2i Vector2i)
public bool InBounds(Vector2i vector)
{
if (Vector2i.X < _indices.X || Vector2i.Y < _indices.Y) return false;
if (Vector2i.X >= _indices.X + ChunkSize || Vector2i.Y >= _indices.Y + ChunkSize) return false;
if (vector.X < _indices.X || vector.Y < _indices.Y) return false;
if (vector.X >= _indices.X + ChunkSize || vector.Y >= _indices.Y + ChunkSize) return false;
return true;
}

View File

@@ -83,10 +83,10 @@ namespace Content.Server.Actions.Actions
SoundSystem.Play(Filter.Pvs(args.Performer), PunchMissSound.GetSound(), args.Performer, AudioHelpers.WithVariation(0.025f));
args.Performer.PopupMessageOtherClients(Loc.GetString("disarm-action-popup-message-other-clients",
("performerName", Name: entMan.GetComponent<MetaDataComponent>(args.Performer).EntityName),
("targetName", Name: entMan.GetComponent<MetaDataComponent>(args.Target).EntityName)));
("performerName", entMan.GetComponent<MetaDataComponent>(args.Performer).EntityName),
("targetName", entMan.GetComponent<MetaDataComponent>(args.Target).EntityName)));
args.Performer.PopupMessageCursor(Loc.GetString("disarm-action-popup-message-cursor",
("targetName", Name: entMan.GetComponent<MetaDataComponent>(args.Target).EntityName)));
("targetName", entMan.GetComponent<MetaDataComponent>(args.Target).EntityName)));
system.SendLunge(angle, args.Performer);
return;
}

View File

@@ -1,4 +1,3 @@
#nullable enable
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -22,6 +21,7 @@ using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Network;
using Robust.Shared.Utility;
using System.Text.Json.Serialization;
namespace Content.Server.Administration
{
@@ -94,8 +94,8 @@ namespace Content.Server.Administration
var payload = new WebhookPayload()
{
username = oldMessage.username,
content = oldMessage.content
Username = oldMessage.username,
Content = oldMessage.content
};
if (oldMessage.id == string.Empty)
@@ -242,14 +242,14 @@ namespace Content.Server.Administration
private struct WebhookPayload
{
// ReSharper disable once InconsistentNaming
public string username { get; set; } = "";
[JsonPropertyName("username")]
public string Username { get; set; } = "";
// ReSharper disable once InconsistentNaming
public string content { get; set; } = "";
[JsonPropertyName("content")]
public string Content { get; set; } = "";
// ReSharper disable once InconsistentNaming
public Dictionary<string, string[]> allowed_mentions { get; set; } =
[JsonPropertyName("allowed_mentions")]
public Dictionary<string, string[]> AllowedMentions { get; set; } =
new()
{
{ "parse", Array.Empty<string>() }

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Content.Server.Atmos.Components;
using Content.Shared.Atmos;
using Content.Shared.Atmos.EntitySystems;
@@ -155,8 +155,8 @@ namespace Content.Server.Atmos.EntitySystems
{
for (var x = 0; x < LocalViewRange; x++)
{
var Vector2i = new Vector2i(baseTile.X + x, baseTile.Y + y);
debugOverlayContent[index++] = ConvertTileToData(_atmosphereSystem.GetTileAtmosphereOrCreateSpace(grid, gam, Vector2i));
var vector = new Vector2i(baseTile.X + x, baseTile.Y + y);
debugOverlayContent[index++] = ConvertTileToData(_atmosphereSystem.GetTileAtmosphereOrCreateSpace(grid, gam, vector));
}
}

View File

@@ -685,7 +685,7 @@ namespace Content.Server.Botany.Components
}
user.PopupMessageCursor(Loc.GetString("plant-holder-component-already-seeded-message",
("name", Name: _entMan.GetComponent<MetaDataComponent>(Owner).EntityName)));
("name", _entMan.GetComponent<MetaDataComponent>(Owner).EntityName)));
return false;
}
@@ -694,9 +694,9 @@ namespace Content.Server.Botany.Components
if (WeedLevel > 0)
{
user.PopupMessageCursor(Loc.GetString("plant-holder-component-remove-weeds-message",
("name", Name: _entMan.GetComponent<MetaDataComponent>(Owner).EntityName)));
("name", _entMan.GetComponent<MetaDataComponent>(Owner).EntityName)));
user.PopupMessageOtherClients(Loc.GetString("plant-holder-component-remove-weeds-others-message",
("otherName", Name: _entMan.GetComponent<MetaDataComponent>(user).EntityName)));
("otherName", _entMan.GetComponent<MetaDataComponent>(user).EntityName)));
WeedLevel = 0;
UpdateSprite();
}
@@ -713,9 +713,9 @@ namespace Content.Server.Botany.Components
if (Seed != null)
{
user.PopupMessageCursor(Loc.GetString("plant-holder-component-remove-plant-message",
("name", Name: _entMan.GetComponent<MetaDataComponent>(Owner).EntityName)));
("name", _entMan.GetComponent<MetaDataComponent>(Owner).EntityName)));
user.PopupMessageOtherClients(Loc.GetString("plant-holder-component-remove-plant-others-message",
("name", Name: _entMan.GetComponent<MetaDataComponent>(user).EntityName)));
("name", _entMan.GetComponent<MetaDataComponent>(user).EntityName)));
RemovePlant();
}
else

View File

@@ -30,7 +30,7 @@ namespace Content.Server.Botany.Components
if (_entMan.TryGetComponent(eventArgs.Using, out ProduceComponent? produce) && produce.Seed != null)
{
eventArgs.User.PopupMessageCursor(Loc.GetString("seed-extractor-component-interact-message",("name", Name: _entMan.GetComponent<MetaDataComponent>(eventArgs.Using).EntityName)));
eventArgs.User.PopupMessageCursor(Loc.GetString("seed-extractor-component-interact-message",("name", _entMan.GetComponent<MetaDataComponent>(eventArgs.Using).EntityName)));
_entMan.QueueDeleteEntity(eventArgs.Using);

View File

@@ -196,7 +196,7 @@ namespace Content.Server.Chat.Managers
var msg = _netManager.CreateNetMessage<MsgChatMessage>();
msg.Channel = ChatChannel.Local;
msg.Message = message;
msg.MessageWrap = Loc.GetString("chat-manager-entity-say-wrap-message",("entityName", Name: _entManager.GetComponent<MetaDataComponent>(source).EntityName));
msg.MessageWrap = Loc.GetString("chat-manager-entity-say-wrap-message",("entityName", _entManager.GetComponent<MetaDataComponent>(source).EntityName));
msg.SenderEntity = source;
msg.HideChat = hideChat;
_netManager.ServerSendToMany(msg, clients);
@@ -233,7 +233,7 @@ namespace Content.Server.Chat.Managers
var msg = _netManager.CreateNetMessage<MsgChatMessage>();
msg.Channel = ChatChannel.Emotes;
msg.Message = action;
msg.MessageWrap = Loc.GetString("chat-manager-entity-me-wrap-message", ("entityName",Name: _entManager.GetComponent<MetaDataComponent>(source).EntityName));
msg.MessageWrap = Loc.GetString("chat-manager-entity-me-wrap-message", ("entityName", _entManager.GetComponent<MetaDataComponent>(source).EntityName));
msg.SenderEntity = source;
_netManager.ServerSendToMany(msg, clients);
}

View File

@@ -11,16 +11,16 @@ namespace Content.Server.Chemistry.EntitySystems
{
public class ChemicalReactionSystem : SharedChemicalReactionSystem
{
protected override void OnReaction(Solution solution, ReactionPrototype reaction, ReagentPrototype randomReagent, EntityUid Owner, FixedPoint2 unitReactions)
protected override void OnReaction(Solution solution, ReactionPrototype reaction, ReagentPrototype randomReagent, EntityUid owner, FixedPoint2 unitReactions)
{
base.OnReaction(solution, reaction, randomReagent, Owner, unitReactions);
base.OnReaction(solution, reaction, randomReagent, owner, unitReactions);
var coordinates = Transform(Owner).Coordinates;
var coordinates = Transform(owner).Coordinates;
_logSystem.Add(LogType.ChemicalReaction, reaction.Impact,
$"Chemical reaction {reaction.ID:reaction} occurred with strength {unitReactions:strength} on entity {ToPrettyString(Owner):metabolizer} at {coordinates}");
$"Chemical reaction {reaction.ID:reaction} occurred with strength {unitReactions:strength} on entity {ToPrettyString(owner):metabolizer} at {coordinates}");
SoundSystem.Play(Filter.Pvs(Owner, entityManager:EntityManager), reaction.Sound.GetSound(), Owner);
SoundSystem.Play(Filter.Pvs(owner, entityManager:EntityManager), reaction.Sound.GetSound(), owner);
}
}
}

View File

@@ -13,6 +13,7 @@ using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Log;
using Robust.Shared.Maths;
using Robust.Shared.Physics;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -160,7 +161,7 @@ namespace Content.Server.Climbing.Components
var result = await EntitySystem.Get<DoAfterSystem>().WaitDoAfter(doAfterEventArgs);
if (result != DoAfterStatus.Cancelled && _entities.TryGetComponent(entityToMove, out PhysicsComponent? body) && body.Fixtures.Count >= 1)
if (result != DoAfterStatus.Cancelled && _entities.TryGetComponent(entityToMove, out FixturesComponent? body) && body.FixtureCount >= 1)
{
var entityPos = _entities.GetComponent<TransformComponent>(entityToMove).WorldPosition;

View File

@@ -38,9 +38,9 @@ namespace Content.Server.Construction.Conditions
if (airlock.BoltsDown != Value)
{
if (Value == true)
args.PushMarkup(Loc.GetString("construction-examine-condition-airlock-bolt", ("entityName", Name: entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
args.PushMarkup(Loc.GetString("construction-examine-condition-airlock-bolt", ("entityName", entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
else
args.PushMarkup(Loc.GetString("construction-examine-condition-airlock-unbolt", ("entityName", Name: entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
args.PushMarkup(Loc.GetString("construction-examine-condition-airlock-unbolt", ("entityName", entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
return true;
}

View File

@@ -36,9 +36,9 @@ namespace Content.Server.Construction.Conditions
if (door.IsWeldedShut != Welded)
{
if (Welded == true)
args.PushMarkup(Loc.GetString("construction-examine-condition-door-weld", ("entityName", Name: entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
args.PushMarkup(Loc.GetString("construction-examine-condition-door-weld", ("entityName", entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
else
args.PushMarkup(Loc.GetString("construction-examine-condition-door-unweld", ("entityName", Name: entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
args.PushMarkup(Loc.GetString("construction-examine-condition-door-unweld", ("entityName", entMan.GetComponent<MetaDataComponent>(entity).EntityName)) + "\n");
return true;
}

View File

@@ -36,7 +36,7 @@ namespace Content.Server.Ghost.Components
msg.Channel = ChatChannel.Radio;
msg.Message = message;
//Square brackets are added here to avoid issues with escaping
msg.MessageWrap = Loc.GetString("chat-radio-message-wrap", ("channel", $"\\[{channel}\\]"), ("name", Name: _entMan.GetComponent<MetaDataComponent>(speaker).EntityName));
msg.MessageWrap = Loc.GetString("chat-radio-message-wrap", ("channel", $"\\[{channel}\\]"), ("name", _entMan.GetComponent<MetaDataComponent>(speaker).EntityName));
_netManager.ServerSendMessage(msg, playerChannel);
}

View File

@@ -74,13 +74,13 @@ namespace Content.Server.Hands.Components
if (ActiveHand != null && Drop(ActiveHand, false))
{
source.PopupMessageOtherClients(Loc.GetString("hands-component-disarm-success-others-message", ("disarmer", Name: _entities.GetComponent<MetaDataComponent>(source).EntityName), ("disarmed", Name: _entities.GetComponent<MetaDataComponent>(target).EntityName)));
source.PopupMessageCursor(Loc.GetString("hands-component-disarm-success-message", ("disarmed", Name: _entities.GetComponent<MetaDataComponent>(target).EntityName)));
source.PopupMessageOtherClients(Loc.GetString("hands-component-disarm-success-others-message", ("disarmer", _entities.GetComponent<MetaDataComponent>(source).EntityName), ("disarmed", _entities.GetComponent<MetaDataComponent>(target).EntityName)));
source.PopupMessageCursor(Loc.GetString("hands-component-disarm-success-message", ("disarmed", _entities.GetComponent<MetaDataComponent>(target).EntityName)));
}
else
{
source.PopupMessageOtherClients(Loc.GetString("hands-component-shove-success-others-message", ("shover", Name: _entities.GetComponent<MetaDataComponent>(source).EntityName), ("shoved", Name: _entities.GetComponent<MetaDataComponent>(target).EntityName)));
source.PopupMessageCursor(Loc.GetString("hands-component-shove-success-message", ("shoved", Name: _entities.GetComponent<MetaDataComponent>(target).EntityName)));
source.PopupMessageOtherClients(Loc.GetString("hands-component-shove-success-others-message", ("shover", _entities.GetComponent<MetaDataComponent>(source).EntityName), ("shoved", _entities.GetComponent<MetaDataComponent>(target).EntityName)));
source.PopupMessageCursor(Loc.GetString("hands-component-shove-success-message", ("shoved", _entities.GetComponent<MetaDataComponent>(target).EntityName)));
}
return true;

View File

@@ -70,7 +70,7 @@ namespace Content.Server.Headset
msg.Channel = ChatChannel.Radio;
msg.Message = message;
//Square brackets are added here to avoid issues with escaping
msg.MessageWrap = Loc.GetString("chat-radio-message-wrap", ("channel", $"\\[{channel}\\]"), ("name", Name: _entMan.GetComponent<MetaDataComponent>(source).EntityName));
msg.MessageWrap = Loc.GetString("chat-radio-message-wrap", ("channel", $"\\[{channel}\\]"), ("name", _entMan.GetComponent<MetaDataComponent>(source).EntityName));
_netManager.ServerSendMessage(msg, playerChannel);
}
}

View File

@@ -30,13 +30,13 @@ namespace Content.Server.Light.Components
public int BurningTemperature = 1400;
[DataField("lightEnergy")]
public float lightEnergy = 0.8f;
public float LightEnergy = 0.8f;
[DataField("lightRadius")]
public float lightRadius = 10;
public float LightRadius = 10;
[DataField("lightSoftness")]
public float lightSoftness = 1;
public float LightSoftness = 1;
[DataField("PowerUse")]
public int PowerUse = 40;

View File

@@ -251,7 +251,7 @@ namespace Content.Server.Light.EntitySystems
case LightBulbState.Normal:
if (powerReceiver.Powered && light.On)
{
SetLight(uid, true, lightBulb.Color, light, lightBulb.lightRadius, lightBulb.lightEnergy, lightBulb.lightSoftness);
SetLight(uid, true, lightBulb.Color, light, lightBulb.LightRadius, lightBulb.LightEnergy, lightBulb.LightSoftness);
appearance?.SetData(PoweredLightVisuals.BulbState, PoweredLightState.On);
var time = _gameTiming.CurTime;
if (time > light.LastThunk + ThunkDelay)

View File

@@ -66,7 +66,7 @@ namespace Content.Server.Lock
args.PushText(Loc.GetString(lockComp.Locked
? "lock-comp-on-examined-is-locked"
: "lock-comp-on-examined-is-unlocked",
("entityName", Name: EntityManager.GetComponent<MetaDataComponent>(lockComp.Owner).EntityName)));
("entityName", EntityManager.GetComponent<MetaDataComponent>(lockComp.Owner).EntityName)));
}
public bool TryLock(EntityUid uid, EntityUid user, LockComponent? lockComp = null)
@@ -80,7 +80,7 @@ namespace Content.Server.Lock
if (!HasUserAccess(uid, user, quiet: false))
return false;
lockComp.Owner.PopupMessage(user, Loc.GetString("lock-comp-do-lock-success", ("entityName",Name: EntityManager.GetComponent<MetaDataComponent>(lockComp.Owner).EntityName)));
lockComp.Owner.PopupMessage(user, Loc.GetString("lock-comp-do-lock-success", ("entityName", EntityManager.GetComponent<MetaDataComponent>(lockComp.Owner).EntityName)));
lockComp.Locked = true;
if(lockComp.LockSound != null)
@@ -103,7 +103,7 @@ namespace Content.Server.Lock
if (!Resolve(uid, ref lockComp))
return;
lockComp.Owner.PopupMessage(user, Loc.GetString("lock-comp-do-unlock-success", ("entityName", Name: EntityManager.GetComponent<MetaDataComponent>(lockComp.Owner).EntityName)));
lockComp.Owner.PopupMessage(user, Loc.GetString("lock-comp-do-unlock-success", ("entityName", EntityManager.GetComponent<MetaDataComponent>(lockComp.Owner).EntityName)));
lockComp.Locked = false;
if (lockComp.UnlockSound != null)

View File

@@ -263,7 +263,7 @@ namespace Content.Server.Nutrition.EntitySystems
if (!drink.Opened)
{
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-not-open",
("owner", Name: EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
("owner", EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
return true;
}
@@ -274,7 +274,7 @@ namespace Content.Server.Nutrition.EntitySystems
drinkSolution.DrainAvailable <= 0)
{
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty",
("entity", Name: EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
("entity", EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
return true;
}
@@ -345,7 +345,7 @@ namespace Content.Server.Nutrition.EntitySystems
if (!drink.Opened)
{
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-not-open",
("owner", Name: EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
("owner", EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
return true;
}
@@ -353,7 +353,7 @@ namespace Content.Server.Nutrition.EntitySystems
drinkSolution.DrainAvailable <= 0)
{
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty",
("entity", Name: EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
("entity", EntityManager.GetComponent<MetaDataComponent>(drink.Owner).EntityName)), uid, Filter.Entities(userUid));
return true;
}

View File

@@ -1,6 +1,5 @@
using Robust.Shared.GameObjects;
using System.Collections.Generic;
using Robust.Shared.GameObjects;
namespace Content.Server.Radio.Components
{

View File

@@ -160,7 +160,7 @@ namespace Content.Server.Suspicion
continue;
}
allies.Add((role.Role!.Mind.CharacterName, Uid: role.Owner));
allies.Add((role.Role!.Mind.CharacterName, role.Owner));
}
return new SuspicionRoleComponentState(Role?.Name, Role?.Antagonist, allies.ToArray());

View File

@@ -25,19 +25,19 @@ namespace Content.Server.Tabletop
const float boardDistanceX = 1.25f;
const float pieceDistanceY = 0.80f;
float getXPosition(float distanceFromSide, bool isLeftSide)
float GetXPosition(float distanceFromSide, bool isLeftSide)
{
var pos = borderLengthX - (distanceFromSide * boardDistanceX);
return isLeftSide ? -pos : pos;
}
float getYPosition(float positionNumber, bool isTop)
float GetYPosition(float positionNumber, bool isTop)
{
var pos = borderLengthY - (pieceDistanceY * positionNumber);
return isTop ? pos : -pos;
}
void addPieces(
void AddPieces(
float distanceFromSide,
int numberOfPieces,
bool isBlackPiece,
@@ -46,26 +46,26 @@ namespace Content.Server.Tabletop
{
for (int i = 0; i < numberOfPieces; i++)
{
session.Entities.Add(entityManager.SpawnEntity(isBlackPiece ? BlackPiecePrototype : WhitePiecePrototype, session.Position.Offset(getXPosition(distanceFromSide, isLeftSide), getYPosition(i, isTop))));
session.Entities.Add(entityManager.SpawnEntity(isBlackPiece ? BlackPiecePrototype : WhitePiecePrototype, session.Position.Offset(GetXPosition(distanceFromSide, isLeftSide), GetYPosition(i, isTop))));
}
}
// Top left
addPieces(0, 5, true, true, true);
AddPieces(0, 5, true, true, true);
// top middle left
addPieces(4, 3, false, true, true);
AddPieces(4, 3, false, true, true);
// top middle right
addPieces(5, 5, false, true, false);
AddPieces(5, 5, false, true, false);
// top far right
addPieces(0, 2, true, true, false);
AddPieces(0, 2, true, true, false);
// bottom left
addPieces(0, 5, false, false, true);
AddPieces(0, 5, false, false, true);
// bottom middle left
addPieces(4, 3, true, false, true);
AddPieces(4, 3, true, false, true);
// bottom middle right
addPieces(5, 5, true, false, false);
AddPieces(5, 5, true, false, false);
// bottom far right
addPieces(0, 2, false, false, false);
AddPieces(0, 2, false, false, false);
}
}
}

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
@@ -61,11 +61,11 @@ namespace Content.Shared.Arcade
public class BlockGameSetScreenMessage : BoundUserInterfaceMessage
{
public readonly BlockGameScreen Screen;
public readonly bool isStarted;
public readonly bool IsStarted;
public BlockGameSetScreenMessage(BlockGameScreen screen, bool isStarted = true)
{
Screen = screen;
this.isStarted = isStarted;
IsStarted = isStarted;
}
}

View File

@@ -359,7 +359,7 @@ namespace Content.Shared.Body.Components
var i = 0;
foreach (var (part, slot) in SlotParts)
{
parts[i] = (slot.Id, Owner: part.Owner);
parts[i] = (slot.Id, part.Owner);
i++;
}

View File

@@ -32,9 +32,9 @@ namespace Content.Shared.Lathe
return true;
}
public bool CanProduce(string ID, int quantity = 1)
public bool CanProduce(string id, int quantity = 1)
{
return PrototypeManager.TryIndex(ID, out LatheRecipePrototype? recipe) && CanProduce(recipe, quantity);
return PrototypeManager.TryIndex(id, out LatheRecipePrototype? recipe) && CanProduce(recipe, quantity);
}
/// <summary>

View File

@@ -17,13 +17,13 @@ namespace Content.Shared.Lathe
[ViewVariables]
protected virtual Dictionary<string, int> Storage { get; set; } = new();
public int this[string ID]
public int this[string id]
{
get
{
if (!Storage.ContainsKey(ID))
if (!Storage.ContainsKey(id))
return 0;
return Storage[ID];
return Storage[id];
}
}
@@ -31,10 +31,10 @@ namespace Content.Shared.Lathe
{
get
{
var ID = material.ID;
if (!Storage.ContainsKey(ID))
var id = material.ID;
if (!Storage.ContainsKey(id))
return 0;
return Storage[ID];
return Storage[id];
}
}

View File

@@ -1,4 +1,4 @@
using System.IO;
using System.IO;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
@@ -22,9 +22,9 @@ namespace Content.Tools
Root = stream.Documents[0].RootNode;
TilemapNode = (YamlMappingNode) Root["tilemap"];
GridsNode = (YamlSequenceNode) Root["grids"];
_entitiesNode = (YamlSequenceNode) Root["entities"];
EntitiesNode = (YamlSequenceNode) Root["entities"];
foreach (var entity in _entitiesNode)
foreach (var entity in EntitiesNode)
{
var uid = uint.Parse(entity["uid"].AsString());
if (uid >= NextAvailableEntityId)
@@ -47,7 +47,7 @@ namespace Content.Tools
// Entities lookup
private YamlSequenceNode _entitiesNode { get; }
private YamlSequenceNode EntitiesNode { get; }
public Dictionary<uint, YamlMappingNode> Entities { get; } = new Dictionary<uint, YamlMappingNode>();
@@ -60,9 +60,9 @@ namespace Content.Tools
public void Save(string fileName)
{
// Update entities node
_entitiesNode.Children.Clear();
EntitiesNode.Children.Clear();
foreach (var kvp in Entities)
_entitiesNode.Add(kvp.Value);
EntitiesNode.Add(kvp.Value);
using var writer = new StreamWriter(fileName);
var document = new YamlDocument(Root);