Beispiel #1
0
        private static Stream <DateTime> Periodic(ITimerSystem <DateTime> sys, TimeSpan period)
        {
            Cell <DateTime> time = sys.Time;
            DiscreteCellLoop <Maybe <DateTime> > oAlarm = new DiscreteCellLoop <Maybe <DateTime> >();
            Stream <DateTime> sAlarm = sys.At(oAlarm);

            oAlarm.Loop(sAlarm.Map(t => Maybe.Some(t + period)).Hold(Maybe.Some(time.Sample() + period)));
            return(sAlarm);
        }
Beispiel #2
0
        public static void Init(IntPtr smutilsptr, IntPtr sharesysptr, IntPtr myself, IntPtr playermanager,
			IntPtr timersystem)
        {
            Console.WriteLine (Directory.GetCurrentDirectory());
            HomePath = Path.Combine(Directory.GetCurrentDirectory(), "cstrike/addons/sharpsource");
            ExtensionsPath = Path.Combine(HomePath, "extensions");
            SourceMod = new ISourceMod(new CppInstancePtr(smutilsptr));
            ShareSys = new IShareSys(new CppInstancePtr(sharesysptr));
            Extension = new IExtension(new CppInstancePtr(myself));
            PlayerManager = new IPlayerManager(new CppInstancePtr(playermanager));
            TimerSystem = new ITimerSystem(new CppInstancePtr(timersystem));
            Init();
        }
Beispiel #3
0
 public static void Init(IntPtr smutilsptr, IntPtr sharesysptr, IntPtr myself, IntPtr playermanager,
                         IntPtr timersystem)
 {
     Console.WriteLine(Directory.GetCurrentDirectory());
     HomePath       = Path.Combine(Directory.GetCurrentDirectory(), "cstrike/addons/sharpsource");
     ExtensionsPath = Path.Combine(HomePath, "extensions");
     SourceMod      = new ISourceMod(new CppInstancePtr(smutilsptr));
     ShareSys       = new IShareSys(new CppInstancePtr(sharesysptr));
     Extension      = new IExtension(new CppInstancePtr(myself));
     PlayerManager  = new IPlayerManager(new CppInstancePtr(playermanager));
     TimerSystem    = new ITimerSystem(new CppInstancePtr(timersystem));
     Init();
 }