Shifted Settings.Globals to Variables.Global

This commit is contained in:
Michael Smith 2016-02-24 23:04:05 -08:00
parent ac6f3c2f51
commit 8b05e2af6a
6 changed files with 14 additions and 14 deletions

View File

@ -1,4 +1,5 @@
using OSCADSharp.Solids;
using OSCADSharp.Scripting;
using OSCADSharp.Solids;
using OSCADSharp.Transforms;
using System;
using System.Collections.Generic;
@ -13,10 +14,9 @@ namespace OSCADSharp.ConsoleTests
{
static void Main(string[] args)
{
Settings.Globals["$fn"] = 100;
Variables.Global["$fn"] = 100;
var obj = new Sphere(30);
var pos = obj.Position();
var cyl1 = new Cylinder(1, 100, true).Translate(pos);
var cyl2 = new Cylinder(1, 100, true).Rotate(0, 90, 0).Translate(pos);

View File

@ -160,7 +160,7 @@ namespace OSCADSharp.UnitTests
{
var cube = new Cube();
string[] output = null;
Settings.Globals["$fn"] = 100;
Variables.Global["$fn"] = 100;
var mock = new Mock<IFileWriter>();
mock.Setup(_wrtr => _wrtr.WriteAllLines(It.IsAny<string>(), It.IsAny<string[]>()))

View File

@ -18,7 +18,7 @@ namespace OSCADSharp.UnitTests
public void Settings_NullVariablesDoNothing()
{
var cube = new Cube();
Settings.Globals["thing"] = null;
Variables.Global["thing"] = null;
string[] output = null;
var mock = new Mock<IFileWriter>();

View File

@ -334,7 +334,7 @@ namespace OSCADSharp
Settings.FileWriter.WriteAllLines(path, new string[]
{
Settings.OSCADSharpHeader,
Settings.Globals.ToString(),
Variables.Global.ToString(),
this.ToString()
});

View File

@ -11,6 +11,12 @@ namespace OSCADSharp.Scripting
/// </summary>
public sealed class Variables
{
/// <summary>
/// Global variables that can be assigned for output at the
/// top of OpenSCAD scripts
/// </summary>
public static Variables Global = new Variables();
private Dictionary<string, object> variables = new Dictionary<string, object>();
/// <summary>

View File

@ -18,13 +18,7 @@ namespace OSCADSharp
/// </summary>
public static readonly string OSCADSharpHeader = String.Format("/*Code Generated using OSCADSharp on {0}. {1}{2}For more information, please visit https://github.com/Exolun/OSCADSharp */{3}",
DateTime.Now.ToString(), Environment.NewLine, Environment.NewLine, Environment.NewLine);
/// <summary>
/// Global variables that can be assigned for output at the
/// top of OpenSCAD scripts
/// </summary>
public static Variables Globals = new Variables();
/// <summary>
/// Used to write scripts to file
/// </summary>