Пример #1
0
    void Awake()
    {
        cameraManager = GameObject.Find("Camera").GetComponent <CameraManager>();

        solarManager = GetComponent <SolarManager>();

        FillSolarBodies();
    }
Пример #2
0
 public override SolarState Next(SolarManager manager)
 {
     if (manager.HasReachedEnd(false))
     {
         return(new SolarStateIdlingNight());
     }
     return(null);
 }
Пример #3
0
 public override SolarState Next(SolarManager manager)
 {
     if (!manager.HasOutput(DuskToNightCutoff))
     {
         return(new SolarStateReseting());
     }
     return(null);
 }
Пример #4
0
 protected override SolarState DelayedNext(SolarManager manager)
 {
     if (manager.HasOutputDiminished())
     {
         return(new SolarStateChasing());
     }
     return(null);
 }
Пример #5
0
 public override SolarState Next(SolarManager manager)
 {
     if (manager.HasOutput(NightToDawnCutoff))
     {
         return(new SolarStateIdlingDawn());
     }
     return(null);
 }
Пример #6
0
        public Program()
        {
            this.Runtime.UpdateFrequency = UpdateFrequency.Update1;
            this.manager = Process.CreateManager(this.Echo);
            var logger = new Logger(this.manager, this.Me.GetSurface(0), echo: this.Echo);

            this.command      = new CommandLine("Solar Manager", logger.Log, this.manager);
            this.solarManager = new SolarManager(this, this.command, this.manager, logger.Log);
        }
Пример #7
0
 protected override SolarState DelayedNext(SolarManager manager)
 {
     if (manager.HasReachedEnd(true))
     {
         return(new SolarStateIdlingDusk());
     }
     else if (manager.HasOutputDiminished() || iteration++ > 1)
     {
         return(new SolarStateIdlingDay());
     }
     return(null);
 }
Пример #8
0
    /// <summary>
    /// Generates a texture map for every solarbody in the system
    /// </summary>
    public void GenerateMaps()
    {
        if (solarManager == null)
        {
            solarManager = FindObjectOfType <SolarManager>();
        }

        SolarBody sun = GameObject.Find("Sun").GetComponent <SolarBody>();

        GenerateMap(sun);

        GenerateSatelliteMaps(solarManager.GetSolarBodies());
    }
Пример #9
0
            public SolarState Handle(SolarManager manager)
            {
                SolarState next = Next(manager);

                if (next != null)
                {
                    Transition(this, next, manager);
                }
                else
                {
                    Act(manager);
                    next = this;
                }
                return(next);
            }
Пример #10
0
 public override SolarState Next(SolarManager manager)
 {
     if (Delay >= MaxDelay)
     {
         return(DelayedNext(manager));
     }
     else
     {
         if (manager.WasLastTickRelevant())
         {
             ++Delay;
         }
         return(null);
     }
 }
Пример #11
0
        private void Init()
        {
            // launch tests
            // TestSuite.AllTests.TestAll();
            // Initialization
            mainBatteriesManager      = new BatteryManager(battery => battery.CubeGrid == Me.CubeGrid);
            connectedBatteriesManager = new BatteryManager(battery => battery.CubeGrid != Me.CubeGrid);
            display      = new SolarDisplay("Main Base Solar LCD Panel", false);
            solarManager = new SolarManager("A");
            dayTracker   = new DayTracker();

            Deserializer deserializer = new Deserializer(Me.CustomData);

            solarManager.Deserialize(deserializer);
            dayTracker.Deserialize(deserializer);
            solarState = SolarState.Deserialize(deserializer.Get("solarState"));
        }
Пример #12
0
        async void HandleCheckPerson(object sender, CheckPersonEventArgs e)
        {
            if (OwnerActivity.ConnectedToNetwork)
            {
                //Check for existing prospect or customer
                var solarManager = new SolarManager();
                var person       = await solarManager.CheckPerson(e.PhoneNumber);

                if (person != null)
                {
                    OwnerActivity.HideKeyboard();
                    coordinator.onProspectOrCustomerFound(new ProspectCustomerFoundEventArgs(person));
                }
            }
            else
            {
                basicInfo.DisplayNetworkRequiredAlert();
            }
        }
Пример #13
0
 public override void Stop(SolarManager manager) => manager.StopChasing();
Пример #14
0
    void Awake()
    {
        solarManager = FindObjectOfType <SolarManager>();

        GenerateMaps();
    }
Пример #15
0
 protected abstract SolarState DelayedNext(SolarManager manager);
Пример #16
0
 public override void Act(SolarManager manager) => manager.FixAlignment();
Пример #17
0
 public override void Start(SolarManager manager) => manager.ChaseHorizontally();
Пример #18
0
 public virtual void Act(SolarManager manager)
 {
 }
Пример #19
0
 public virtual void Stop(SolarManager manager)
 {
 }
Пример #20
0
 public virtual void Start(SolarManager manager)
 {
 }
Пример #21
0
 public abstract SolarState Next(SolarManager manager);
Пример #22
0
 public static SolarState Transition(SolarState oldState, SolarState newState, SolarManager manager)
 {
     oldState.Stop(manager);
     newState.Start(manager);
     return(newState);
 }
Пример #23
0
 public override void Act(SolarManager manager) => manager.Reset();
Пример #24
0
 /// <summary>
 /// Sets the eitor's target on editor enable
 /// </summary>
 void OnEnable()
 {
     solarManager = (SolarManager)target;
 }