예제 #1
0
파일: Host.cs 프로젝트: pwdlugosz/Spectre
        /// <summary>
        /// Creates a host
        /// </summary>
        public Host()
        {
            // Check the directory
            Host.CheckDir();

            // Timer
            this._Timer = Stopwatch.StartNew();

            // Communicator
            this._IO = new CommandLineCommunicator();

            // Random number generator
            this._RNG = new CellRandom();

            // Tables
            this._Cache = new TableStore(this);

            // Spools
            this._Store = new SpoolSpace();
            this._Store.Add(GLOBAL, new Spool.HeapSpindle(GLOBAL));

            // Libraries
            this._Libraries = new Heap <Library>();
            this._Libraries.Allocate("BASE", new BaseLibrary(this));

            // Engine
            this._Engine = new ScriptProcessor(this);

            // Possibly create a log writer //
            if (DEBUG_STATE == 1)
            {
                this._DebugWriter = new StreamWriter(DebugLogPath);
            }
        }
예제 #2
0
 public RandBool(Host Host, CellRandom Source)
     : base(Host, null, "RANDBOOL", 0, 1)
 {
     this._Source = Source;
 }
예제 #3
0
 public RandCString(Host Host, CellRandom Source)
     : base(Host, null, "RANDCSTRING", 1, 2)
 {
     this._Source = Source;
 }
예제 #4
0
 public RandBinary(Host Host, CellRandom Source)
     : base(Host, null, "RANDBINARY", 1, 2)
 {
     this._Source = Source;
 }
예제 #5
0
 public RandDouble(Host Host, CellRandom Source)
     : base(Host, null, "RANDDOUBLE", 0, 2)
 {
     this._Source = Source;
 }
예제 #6
0
 public RandSingle(Host Host, CellRandom Source)
     : base(Host, null, "RANDSINGLE", 0, 2)
 {
     this._Source = Source;
 }
예제 #7
0
 public RandLong(Host Host, CellRandom Source)
     : base(Host, null, "RANDLONG", 0, 2)
 {
     this._Source = Source;
 }
예제 #8
0
 public RandInt(Host Host, CellRandom Source)
     : base(Host, null, "RANDINT", 0, 2)
 {
     this._Source = Source;
 }
예제 #9
0
 public RandShort(Host Host, CellRandom Source)
     : base(Host, null, "RANDSHORT", 0, 2)
 {
     this._Source = Source;
 }
예제 #10
0
 public LibraryRandom(Host Host)
     : base(Host, "RANDOM")
 {
     this._Source = Host.BaseRNG;
 }
예제 #11
0
 public RandByte(Host Host, CellRandom Source)
     : base(Host, null, "RANDBYTE", 0, 2)
 {
     this._Source = Source;
 }
예제 #12
0
파일: Host.cs 프로젝트: pwdlugosz/Spectre
 /// <summary>
 /// Sets the RNG seed
 /// </summary>
 /// <param name="Seed"></param>
 public void SetSeed(int Seed)
 {
     this._RNG = new CellRandom(Seed);
 }