Bug fixes and tuning
This commit is contained in:
@ -42,7 +42,7 @@ namespace RobloxFiles.Utility
|
||||
/// There are some name duplicates, but that's an issue on Roblox's end.
|
||||
/// </summary>
|
||||
|
||||
public static IReadOnlyList<BrickColor> ColorMap = new List<BrickColor>()
|
||||
public static readonly IReadOnlyList<BrickColor> ColorMap = new List<BrickColor>()
|
||||
{
|
||||
new BrickColor( 1, 0xF2F3F3, "White"),
|
||||
new BrickColor( 2, 0xA1A5A2, "Grey"),
|
||||
|
@ -1,8 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using RobloxFiles.Enums;
|
||||
|
||||
@ -10,7 +7,7 @@ namespace RobloxFiles.Utility
|
||||
{
|
||||
public static class FontUtility
|
||||
{
|
||||
public static IReadOnlyDictionary<int, FontSize> FontSizes = new Dictionary<int, FontSize>()
|
||||
public static readonly IReadOnlyDictionary<int, FontSize> FontSizes = new Dictionary<int, FontSize>()
|
||||
{
|
||||
{ 8, FontSize.Size8 },
|
||||
{ 9, FontSize.Size9 },
|
||||
@ -29,8 +26,6 @@ namespace RobloxFiles.Utility
|
||||
{ 96, FontSize.Size96 },
|
||||
};
|
||||
|
||||
private static Dictionary<int, FontSize> IntToFontSize = new Dictionary<int, FontSize>();
|
||||
|
||||
public static FontSize GetFontSize(int fontSize)
|
||||
{
|
||||
if (fontSize > 60)
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace RobloxFiles.Utility
|
||||
@ -14,12 +15,20 @@ namespace RobloxFiles.Utility
|
||||
|
||||
public static ImplicitMember Get(Type type, string name)
|
||||
{
|
||||
var field = type.GetField(name, flags);
|
||||
var prop = type.GetProperty(name, flags);
|
||||
var field = type
|
||||
.GetFields(flags)
|
||||
.Where(f => f.Name == name)
|
||||
.FirstOrDefault();
|
||||
|
||||
if (field != null)
|
||||
return new ImplicitMember(field);
|
||||
else if (prop != null)
|
||||
|
||||
var prop = type
|
||||
.GetProperties(flags)
|
||||
.Where(p => p.Name == name)
|
||||
.FirstOrDefault();
|
||||
|
||||
if (prop != null)
|
||||
return new ImplicitMember(prop);
|
||||
|
||||
return null;
|
||||
|
@ -12,7 +12,7 @@ namespace RobloxFiles.Utility
|
||||
/// <summary>
|
||||
/// A dictionary mapping materials to their default Density.
|
||||
/// </summary>
|
||||
public static IReadOnlyDictionary<Material, float> DensityMap = new Dictionary<Material, float>()
|
||||
public static readonly IReadOnlyDictionary<Material, float> DensityMap = new Dictionary<Material, float>()
|
||||
{
|
||||
{Material.Air, 0.01f},
|
||||
{Material.Asphalt, 2.36f},
|
||||
@ -56,7 +56,7 @@ namespace RobloxFiles.Utility
|
||||
/// <summary>
|
||||
/// A dictionary mapping materials to their default Elasticity.
|
||||
/// </summary>
|
||||
public static IReadOnlyDictionary<Material, float> ElasticityMap = new Dictionary<Material, float>()
|
||||
public static readonly IReadOnlyDictionary<Material, float> ElasticityMap = new Dictionary<Material, float>()
|
||||
{
|
||||
{Material.Air, 0.01f},
|
||||
{Material.Asphalt, 0.20f},
|
||||
@ -100,7 +100,7 @@ namespace RobloxFiles.Utility
|
||||
/// <summary>
|
||||
/// A dictionary mapping materials to their default Friction.
|
||||
/// </summary>
|
||||
public static IReadOnlyDictionary<Material, float> FrictionMap = new Dictionary<Material, float>()
|
||||
public static readonly IReadOnlyDictionary<Material, float> FrictionMap = new Dictionary<Material, float>()
|
||||
{
|
||||
{Material.Air, 0.01f},
|
||||
{Material.Asphalt, 0.80f},
|
||||
@ -146,7 +146,7 @@ namespace RobloxFiles.Utility
|
||||
/// NOTE: This only maps materials that have different FrictionWeights.<para/>
|
||||
/// If it isn't in here, assume their FrictionWeight is 1.
|
||||
/// </summary>
|
||||
public static IReadOnlyDictionary<Material, float> FrictionWeightMap = new Dictionary<Material, float>()
|
||||
public static readonly IReadOnlyDictionary<Material, float> FrictionWeightMap = new Dictionary<Material, float>()
|
||||
{
|
||||
{Material.Asphalt, 0.30f},
|
||||
{Material.Basalt, 0.30f},
|
||||
|
Reference in New Issue
Block a user