protected override async void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); Setup.Start(FindViewById <FrameLayout>(Resource.Id.Main_Layout), this).RunInParallel(); await(StartUp.Current = new UI.StartUp()).Run(); }
public void StartTest() { var result = Setup.Start(); Logger.Verify(x => x.Fatal(It.IsAny <string>()), Times.Never, "We logged a fatal message! That shouldn't happen"); Assert.That(result, Is.True, "We could not setup the application correctly"); Sql.Verify(x => x.CheckDb(), Times.Once); Sql.Verify(x => x.DbConnection(), Times.Once); DbConnection.Verify(x => x.Open(), Times.Exactly(2)); DbConnection.Verify(x => x.Close(), Times.AtLeastOnce); }
void Start() { Setup.Start(); Setup.Pause = false; for (int z = 0; z < 31; z++) { for (int x = 0; x < 31; x++) { GameObject NO = Instantiate(PlanePol); NO.transform.position = new Vector3(x, 0, z); NO.name = "PlaneP"; NO.transform.parent = GameObject.Find("Pole").transform; } } String s = PlayerPrefs.GetString(string.Format("robot{0}", Setup.IdActiveRobot)); routine = StartCoroutine(Setup.LoadRobot(s)); for (int i = 0; i < Setup.RobotsCount; i++) { GameObject PanelItem = Instantiate(GameObject.Find("testPanelItem"), GameObject.Find("PanelPreview").transform); PanelItem.name = string.Format("PanelItem{0}", i); Texture2D t = new Texture2D(200, 170); t = Setup.ReadTextureFromPlayerPrefs(string.Format("preview{0}", i)); if (t == null) { t = new Texture2D(200, 170); for (int y = 0; y < t.height; y++) { for (int x = 0; x < t.width; x++) { t.SetPixel(x, y, new Color(34, 39, 48)); } } t.Apply(); } PanelItem.transform.Find("Image").GetComponent <Image>().sprite = Sprite.Create(t, new Rect(0, 0, 200, 170), new Vector2(0, 0)); PanelItem.transform.Find("InputField").GetComponent <InputField>().text = PlayerPrefs.GetString(string.Format("robotName{0}", i)); PanelItem.transform.Find("InputField").GetComponent <InputField>().onValueChanged.AddListener(delegate { ValueChangeCheck(PanelItem); }); //PanelItem.transform.Find("InputField").GetComponent<InputField>().onClick.AddListener(() => TextOnClick(PanelItem.transform.Find("InputField").GetComponent<InputField>())); //textField.becomeFirstResponder() //textField.selectAll(nil) PanelItem.GetComponent <Button>().onClick.AddListener(() => PanelOnClick(PanelItem)); } Destroy(GameObject.Find("testPanelItem")); GameObject.Find("AddRobotPanel").GetComponent <Button>().onClick.AddListener(AddRobot); Cursor.visible = true; Cursor.lockState = CursorLockMode.None; }
public void StartWithExceptionLogsToLogger() { Sql.Setup(x => x.CheckDb()).Throws(new DataException()); Setup = new Setup(Sql.Object, Logger.Object, Db.Object); var result = Setup.Start(); Sql.Verify(x => x.CheckDb(), Times.Once); Sql.Verify(x => x.DbConnection(), Times.Never); DbConnection.Verify(x => x.Open(), Times.Never); DbConnection.Verify(x => x.Close(), Times.Never); Logger.Verify(x => x.Fatal(It.IsAny <string>()), Times.Once); Logger.Verify(x => x.Fatal(It.IsAny <Exception>()), Times.Once); Assert.That(result, Is.False); }
// Use this for initialization void Start() { texture = new Texture2D(1, 1); style = new GUIStyle(); style.fontSize = 20; style.normal.textColor = Color.red; style.alignment = TextAnchor.MiddleCenter; shadow = new GUIStyle(); shadow.fontSize = 20; shadow.normal.textColor = Color.black; shadow.alignment = TextAnchor.MiddleCenter; cam = transform.GetComponent <Camera>(); Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; Setup.Start(); Setup.Pause = false; Info = new Dictionary <int, InfoFigure>(); Robo = new Dictionary <string, InfoRobot>(); robot3 = CreateRobot("Robot 3", -15, -15); CreateInfo(robot3); CreateRotors(robot3); DestroyPlanes(robot3); robot2 = CreateRobot("Robot 2", -5, -5); CreateInfo(robot2); CreateRotors(robot2); DestroyPlanes(robot2); myrobot = CreateRobot("MyRobot"); CreateInfo(myrobot); CreateWeaponPanel(); CreateWeapons(myrobot); myrobot.AddComponent <PlayerOrbitCamera>(); //myrobot.AddComponent<RobotTrigger>(); Rotors = CreateRotors(myrobot); DestroyPlanes(myrobot); CreateWheels(myrobot); //print("Weapons=" + Weapons.Length + " Rotors=" + Rotors.Length + " Wheels=" + Wheels.Length); }
//static MainActivity() //{ // UIRuntime.GetEntryAssembly = () => typeof(MainActivity).Assembly; //} protected override async void OnCreate(Bundle bundle) { base.OnCreate(bundle); Xamarin.Essentials.Platform.Init(this, bundle); SetContentView(Resource.Layout.Main); Setup.Start(FindViewById <FrameLayout>(Resource.Id.Main_Layout), this).RunInParallel(); if (AlreadyCreated) { Setup.SwitchActivity(FindViewById <FrameLayout>(Resource.Id.Main_Layout), this); } else { AlreadyCreated = true; Setup.Start(FindViewById <FrameLayout>(Resource.Id.Main_Layout), this).RunInParallel(); await(StartUp.Current = new UI.StartUp()).Run(); } }
public void StartWithExceptionLogsToLogger() { Sql.Setup(x => x.CheckDb()).Throws(new DataException()); Setup = new Setup(Sql.Object, Logger.Object, Db.Object); var result = Setup.Start(); Sql.Verify(x => x.CheckDb(), Times.Once); Sql.Verify(x => x.DbConnection(), Times.Never); DbConnection.Verify(x => x.Open(), Times.Never); DbConnection.Verify(x => x.Close(), Times.Never); Logger.Verify(x => x.Fatal(It.IsAny<string>()), Times.Once); Logger.Verify(x => x.Fatal(It.IsAny<Exception>()), Times.Once); Assert.That(result, Is.False); }
public Worker(ILogger <Worker> logger) { Setup.Start(Util.HOMEBASE.TOP); _logger = logger; }