void Awake() { cameraManager = GameObject.Find("Camera").GetComponent <CameraManager>(); solarManager = GetComponent <SolarManager>(); FillSolarBodies(); }
public override SolarState Next(SolarManager manager) { if (manager.HasReachedEnd(false)) { return(new SolarStateIdlingNight()); } return(null); }
public override SolarState Next(SolarManager manager) { if (!manager.HasOutput(DuskToNightCutoff)) { return(new SolarStateReseting()); } return(null); }
protected override SolarState DelayedNext(SolarManager manager) { if (manager.HasOutputDiminished()) { return(new SolarStateChasing()); } return(null); }
public override SolarState Next(SolarManager manager) { if (manager.HasOutput(NightToDawnCutoff)) { return(new SolarStateIdlingDawn()); } return(null); }
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); }
protected override SolarState DelayedNext(SolarManager manager) { if (manager.HasReachedEnd(true)) { return(new SolarStateIdlingDusk()); } else if (manager.HasOutputDiminished() || iteration++ > 1) { return(new SolarStateIdlingDay()); } return(null); }
/// <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()); }
public SolarState Handle(SolarManager manager) { SolarState next = Next(manager); if (next != null) { Transition(this, next, manager); } else { Act(manager); next = this; } return(next); }
public override SolarState Next(SolarManager manager) { if (Delay >= MaxDelay) { return(DelayedNext(manager)); } else { if (manager.WasLastTickRelevant()) { ++Delay; } return(null); } }
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")); }
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(); } }
public override void Stop(SolarManager manager) => manager.StopChasing();
void Awake() { solarManager = FindObjectOfType <SolarManager>(); GenerateMaps(); }
protected abstract SolarState DelayedNext(SolarManager manager);
public override void Act(SolarManager manager) => manager.FixAlignment();
public override void Start(SolarManager manager) => manager.ChaseHorizontally();
public virtual void Act(SolarManager manager) { }
public virtual void Stop(SolarManager manager) { }
public virtual void Start(SolarManager manager) { }
public abstract SolarState Next(SolarManager manager);
public static SolarState Transition(SolarState oldState, SolarState newState, SolarManager manager) { oldState.Stop(manager); newState.Start(manager); return(newState); }
public override void Act(SolarManager manager) => manager.Reset();
/// <summary> /// Sets the eitor's target on editor enable /// </summary> void OnEnable() { solarManager = (SolarManager)target; }