Merge remote-tracking branch 'upstream/master' into 20-11-19-sandboxing
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Utility;
|
||||
@@ -13,8 +12,8 @@ namespace Content.Shared.Alert
|
||||
[Prototype("alertOrder")]
|
||||
public class AlertOrderPrototype : IPrototype, IComparer<AlertPrototype>
|
||||
{
|
||||
private Dictionary<AlertType, int> _typeToIdx = new Dictionary<AlertType, int>();
|
||||
private Dictionary<AlertCategory, int> _categoryToIdx = new Dictionary<AlertCategory, int>();
|
||||
private readonly Dictionary<AlertType, int> _typeToIdx = new Dictionary<AlertType, int>();
|
||||
private readonly Dictionary<AlertCategory, int> _categoryToIdx = new Dictionary<AlertCategory, int>();
|
||||
|
||||
public void LoadFrom(YamlMappingNode mapping)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
using Content.Shared.Maps;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Serialization;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Content.Shared.Construction.ConstructionConditions
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public class TileType : IConstructionCondition
|
||||
{
|
||||
|
||||
public List<string> TargetTiles { get; private set; }
|
||||
public void ExposeData(ObjectSerializer serializer)
|
||||
{
|
||||
serializer.DataField(this, x => x.TargetTiles, "targets", null);
|
||||
}
|
||||
|
||||
public bool Condition(IEntity user, EntityCoordinates location, Direction direction)
|
||||
{
|
||||
if (TargetTiles == null) return true;
|
||||
|
||||
var tileFound = location.GetTileRef();
|
||||
|
||||
if (tileFound == null)
|
||||
return false;
|
||||
|
||||
var tile = TurfHelpers.GetContentTileDefinition(tileFound.Value.Tile);
|
||||
foreach (var targetTile in TargetTiles)
|
||||
{
|
||||
if (tile.Name == targetTile) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ namespace Content.Shared.Construction
|
||||
public class ConstructionGraphPrototype : IPrototype, IIndexedPrototype
|
||||
{
|
||||
private readonly Dictionary<string, ConstructionGraphNode> _nodes = new Dictionary<string, ConstructionGraphNode>();
|
||||
private Dictionary<ValueTuple<string, string>, ConstructionGraphNode[]> _paths = new Dictionary<ValueTuple<string, string>, ConstructionGraphNode[]>();
|
||||
private readonly Dictionary<ValueTuple<string, string>, ConstructionGraphNode[]> _paths = new Dictionary<ValueTuple<string, string>, ConstructionGraphNode[]>();
|
||||
private Dictionary<ConstructionGraphNode, ConstructionGraphNode> _pathfinding = new Dictionary<ConstructionGraphNode, ConstructionGraphNode>();
|
||||
|
||||
[ViewVariables]
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Content.Shared.GameObjects.Components.Body.Part
|
||||
public IReadOnlyList<string> MechanismIds => _mechanismIds;
|
||||
|
||||
[ViewVariables]
|
||||
private HashSet<IMechanism> _mechanisms = new HashSet<IMechanism>();
|
||||
private readonly HashSet<IMechanism> _mechanisms = new HashSet<IMechanism>();
|
||||
|
||||
[ViewVariables]
|
||||
public IBody? Body
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Content.Shared.GameObjects.Components.Research
|
||||
public override string Name => "LatheDatabase";
|
||||
public override uint? NetID => ContentNetIDs.LATHE_DATABASE;
|
||||
|
||||
private List<LatheRecipePrototype> _recipes = new List<LatheRecipePrototype>();
|
||||
private readonly List<LatheRecipePrototype> _recipes = new List<LatheRecipePrototype>();
|
||||
|
||||
/// <summary>
|
||||
/// Removes all recipes from the database if it's not static.
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Content.Shared.GameObjects.Components.Research
|
||||
public override string Name => "ProtolatheDatabase";
|
||||
public sealed override uint? NetID => ContentNetIDs.PROTOLATHE_DATABASE;
|
||||
|
||||
private List<LatheRecipePrototype> _protolatheRecipes = new List<LatheRecipePrototype>();
|
||||
private readonly List<LatheRecipePrototype> _protolatheRecipes = new List<LatheRecipePrototype>();
|
||||
|
||||
/// <summary>
|
||||
/// A full list of recipes this protolathe can print.
|
||||
|
||||
@@ -125,6 +125,7 @@ namespace Content.Shared.GameObjects.Components
|
||||
{
|
||||
Metal,
|
||||
Glass,
|
||||
ReinforcedGlass,
|
||||
Plasteel,
|
||||
Cable,
|
||||
Wood,
|
||||
@@ -139,6 +140,7 @@ namespace Content.Shared.GameObjects.Components
|
||||
FloorTileCarpet,
|
||||
FloorTileWhite,
|
||||
FloorTileDark,
|
||||
FloorTileWood
|
||||
FloorTileWood,
|
||||
MetalRod
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,11 +54,13 @@ namespace Content.Shared.Maps
|
||||
if (!coordinates.IsValid(entityManager))
|
||||
return null;
|
||||
|
||||
|
||||
mapManager ??= IoCManager.Resolve<IMapManager>();
|
||||
|
||||
if (!mapManager.TryGetGrid(coordinates.GetGridId(entityManager), out var grid))
|
||||
return null;
|
||||
|
||||
|
||||
if (!grid.TryGetTileRef(coordinates, out var tile))
|
||||
return null;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Shared.Physics
|
||||
{
|
||||
public abstract class FrictionController : VirtualController
|
||||
{
|
||||
[Dependency] private IPhysicsManager _physicsManager = default!;
|
||||
[Dependency] private readonly IPhysicsManager _physicsManager = default!;
|
||||
|
||||
public override void UpdateAfterProcessing()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user