// Unlimited bubbles are positioned in a random orientation private void PopulateUnlimitedBubbles() { if (!internalStateCurrentHasInit) { DataGeneral readOnlyData = data.GetDataGeneral(); int seed = readOnlyData.seed; int level = readOnlyData.level; rand = new Utils.WichmannRng(seed + level); bubbles.Clear(); guideLines.Clear(); float bubbleCountFloat = 12.0f * Mathf.Log10(((float)level) + 9.1f) - 9.9f; while (bubbles.Count < bubbleCountFloat) { double x = (rand.Next() - 0.5f) * 2; double y = (rand.Next() - 0.5f) * 2; DataPoint screenSize = inputManager.ScreenSizeWorld(); DataPoint pos = new DataPoint(x * (screenSize.X - bubbleRadiusStandard), y * (screenSize.Y - bubbleRadiusStandard * 2)); bubbles.Add(new DataBubble(new DataPoint(pos))); } events.OnBubblesChange?.Invoke(bubbles); events.OnGuideLinesChange?.Invoke(guideLines); internalStateCurrentHasInit = true; } }
private bool _notContinue = true; //Cuando Cierras el login pero sigues logeo, se debe cerrar toda la aplicacion #endregion Fields #region Constructors public frm_Login( DataGeneral dts ) { this._data = dts; InitializeComponent(); bool rememberme = Convert.ToBoolean( this._lg.getAppSettings( "Remember_me" ) ); this.ptbImagePorfile.ImageLocation = this._lg.ConfigBaseUrl + "static/img/pdefault_lg.png"; if ( ! rememberme ) { this._cf.RemembermeOf(); } if ( string.IsNullOrEmpty( this._lg.getAppSettings( "Auth-Token" ) ) ) { this.panelLogin.Enabled = true; this.panelAcceder.Enabled = false; this.spcPaneles.Panel1Collapsed = false; this.spcPaneles.Panel2Collapsed = true; this.panelMain.Enabled = true; this.AcceptButton = this.btnIngresar; this.isLogged = false; this.tgRemenber1.Checked = Convert.ToBoolean( this._lg.getAppSettings( "Remember_me" ) ); } else { this.panelLogin.Enabled = false; this.panelAcceder.Enabled = true; this.panelInputPassword2.Visible = false; this.metroLabel2.Visible = false; this.tgRemenber2.Visible = false; this.ptbImagePorfile.Location = new Point( 129, 60 ); this.lblFullName.Location = new Point( 50, 211 ); this.lblCargo.Location = new Point( 6, 239 ); this.btnContinuar.Location = new Point( 145, 310 ); this.btnCambiar.Location = new Point( 72, 310 ); this.spcPaneles.Panel1Collapsed = true; this.spcPaneles.Panel2Collapsed = false; string src = this._lg.getAppSettings( "UserPictureUrl" ); if ( !string.IsNullOrEmpty(src) ) { this.ptbImagePorfile.ImageLocation = src; } else { this.ptbImagePorfile.ImageLocation = this._lg.ConfigBaseUrl + "static/img/pdefault_lg.png"; } this.lblFullName.Text = this._lg.getAppSettings( "UserName" ); this.lblCargo.Text = this._lg.getAppSettings( "UserType" ); this.tgRemenber2.Checked = Convert.ToBoolean( this._lg.getAppSettings( "Remember_me" ) ); this.AcceptButton = this.btnContinuar; this.isLogged = true; this.panelMain.Enabled = true; } }
public DataGeneral GetData() { string readFile = SavePath() + statsFile; try { string text = System.IO.File.ReadAllText(readFile); if (text != null) { DataGeneral data = DataGeneral.Defaults(); data.FromString(text); return(data); } } catch (System.Exception) { Debug.Log("Couldn't find any save file - making a new one!"); } DataGeneral dataNew = DataGeneral.Defaults(); SetData(dataNew); return(DataGeneral.Defaults()); }
public frm_Configuration( DataGeneral dts ) { this._data = dts; InitializeComponent(); this.lblFullName.Text = this._cf.getAppSettings( "UserName" ); this.lblCargo.Text = this._cf.getAppSettings( "UserType" ); string src = this._cf.getAppSettings( "UserPictureUrl" ); this.ptbImagePorfile.ImageLocation = string.IsNullOrEmpty(src) ? this._cf.ConfigBaseUrl + "static/img/pdefault_md.png" : src ; }
// Unlimited bubbles are done if we have no bubbles left private void CheckIfDoneUnlimitedBubbles() { if (bubbles.Count < 1) { DataGeneral gen = data.GetDataGeneral(); gen.level = gen.level + 1; data.SetDataGeneral(gen); State = GameState.Game; return; } }
public frm_Personal( DataGeneral dts ) { this._data = dts; InitializeComponent(); this.lblFullName.Text = this._cf.getAppSettings( "UserName" ); this.lblCargo.Text = this._cf.getAppSettings( "UserType" ); this.ptbImagePorfile.ImageLocation = this._cf.getAppSettings( "UserPictureUrl" ); this.lblNameInstitucion.Text = this._cf.getAppSettings( "InstitutionName" ).ToUpper(); this.lblAddressInstitucion.Text = this._cf.getAppSettings( "BranchAddress" ); this.ptbLogoInstitucion.ImageLocation = this._cf.ConfigBaseUrl + this._cf.getAppSettings( "InstitutionLogo" ); }
// Check to see if bubbles have been collected private void CheckIfDoneChallengeBubbles(GameState nextState) { if (CurrentLevel == null || levels == null) { State = GameState.Game; return; } if (bubbles.Count < 1) { int target = levels.levels.IndexOf(CurrentLevel) + 1; if (linesDrawn > 0) { DataGeneral toModify = data.GetDataGeneral(); if (linesDrawn <= star3) { toModify.SetChallengeStats(internalLevel.name, 3); } else if (linesDrawn <= star2) { toModify.SetChallengeStats(internalLevel.name, 2); } else { toModify.SetChallengeStats(internalLevel.name, 1); } data.SetDataGeneral(toModify); } if (target >= levels.levels.Count) { State = GameState.PickChallenge; CurrentLevel = null; return; } else { CurrentLevel = levels.levels[target]; State = nextState; return; } } }
// Search the saved data to see if a name of a level is there, and if so, get data on it. private DataChallenge?GetSavedDataChallenge(SOChallengeList challenges, string toGet) { DataGeneral dataGeneral = data.GetDataGeneral(); string target = toGet.Trim().ToLowerInvariant(); for (int i = 0; i < dataGeneral.challenges.Count; ++i) { string lower = dataGeneral.challenges[i].name.Trim().ToLowerInvariant(); if (lower.Equals(target)) { return(dataGeneral.challenges[i]); } } events.OnNoSaveEntryFound?.Invoke(target); return(null); }
// Copy constructor public DataGeneral(DataGeneral other) { this.seed = other.seed; this.score = other.score; this.level = other.level; this.showTutorial = other.showTutorial; this.showHelp = other.showHelp; this.showParticles = other.showParticles; this.challenges = new List <DataChallenge>(); if (other.challenges != null) { for (int i = 0; i < other.challenges.Count; ++i) { this.challenges.Add(new DataChallenge(other.challenges[i])); } } }
public void Initialize() { if (dataIO != null) { SetDataGeneral(dataIO.GetData()); } else { SetDataGeneral(DataGeneral.Defaults()); Debug.LogWarning("no serialization system was specified for data. Constructing dummy data only."); } events.OnClearSavedData += () => { int savedSeed = dataIO.GetData().seed; DataGeneral resetData = DataGeneral.Defaults(); resetData.seed = savedSeed; SetDataGeneral(resetData); }; }
void GeneralDataInsert(int num_general, int iskin, int grade, int power, int priceJewel, int pricegold, int iweapon, int bbasecap, string korname, string chname, int armytype, string s_char, string m_e, string d_body, string d_helmet) { DataGeneral a = new DataGeneral(); a.iSkin = iskin; a.grade = grade; a.power = power; a.priceJewel = priceJewel; a.priceGold = pricegold; a.iweapon = iweapon; a.basecap = bbasecap; a.korName = korname; a.chName = chname; a.armyType = armytype; a.SsChar = Resources.Load <Sprite>("Data/Char/s_char/" + s_char); // 2d general face a.eye = Resources.Load("Data/Char/" + m_e, typeof(GameObject)) as GameObject; // eye model a.Tbody = Resources.Load("Data/Char/" + d_body, typeof(Texture2D)) as Texture2D; // body texture a.tHelmet = Resources.Load("Data/Char/" + d_helmet, typeof(Texture2D)) as Texture2D; // basecap texture DataManager.Instance.dataGeneral.Add(a); }
public rptMaterialesOfAula(DataGeneral dts) { _data = dts; InitializeComponent(); }
public frmAsignaClase( DataGeneral dts ) { this._data = dts; InitializeComponent(); }
public frm_Director( DataGeneral dts ) { this._data = dts; InitializeComponent(); }
protected override void OnCreateMainForm() { DataGeneral data = new DataGeneral(); this.MainForm = new frm_Login(data); }
public mdlSearch(DataGeneral dts) { this._dts = dts; InitializeComponent(); }
public frmInformeInventario(DataGeneral dts) { InitializeComponent(); }
public frm_Branches( DataGeneral dts ) { this._data = dts; InitializeComponent(); }
public frm_MaterialEnAula( DataGeneral dts, int Codigo ) { this._data = dts; this._codigo = Codigo; InitializeComponent(); }
public frmInformeIngresosPorMaterial(DataGeneral dts) { this._data = dts; InitializeComponent(); }
public frmOpeningOne( DataGeneral dts ) { this._data = dts; InitializeComponent(); }
public frmSearchStudents( DataGeneral dts ) { this._data = dts; InitializeComponent(); }
public frmInitialMessage( DataGeneral dts ) { this._data = dts; InitializeComponent(); }
public frmIngresos(DataGeneral dts) { this._dts = dts; InitializeComponent(); }
public frmAsignarMaterial(DataGeneral dts) { this._data = dts; InitializeComponent(); }
public frm_Income( DataGeneral dts ) { this._data = dts; InitializeComponent(); }
public frmMain( DataGeneral dts ) { _data = dts; InitializeComponent(); }
public void SetDataGeneral(DataGeneral newData) { this.data = new DataGeneral(newData); events.OnDataChanged?.Invoke(data); }
public rptEspecifico(DataGeneral dts) { _data = dts; InitializeComponent(); }
private void Start() { hasInit = false; linesDrawn = 0; internalStateCurrentHasInit = false; bubbles = new List <DataBubble>(); guideLines = new List <Tuple <DataPoint, DataPoint> >(); wasDownPreviously = false; events.OnShowHelpToggle += (isOn) => { DataGeneral toModify = data.GetDataGeneral(); toModify.showHelp = isOn; data.SetDataGeneral(toModify); }; events.OnShowParticlesToggle += (isOn) => { DataGeneral toModify = data.GetDataGeneral(); toModify.showParticles = isOn; data.SetDataGeneral(toModify); }; events.OnTutorialToggle += (isOn) => { DataGeneral toModify = data.GetDataGeneral(); toModify.showTutorial = isOn; data.SetDataGeneral(toModify); }; events.OnNoSaveEntryFound += (name) => { DataGeneral toModify = data.GetDataGeneral(); toModify.challenges.Add(new DataChallenge(0, name)); data.SetDataGeneral(toModify); }; events.OnLevelLoadRequest += (levelName) => { Mode = GameMode.ChallengeLevel; CurrentLevel = levels.GetByName(levelName); PopulateLevelBubbles(CurrentLevel); State = GameState.Game; }; events.OnLevelReloadRequest += () => { Mode = GameMode.ChallengeLevel; CurrentLevel = CurrentLevel; // Done to force the value resets. Not ideal technique for this. PopulateLevelBubbles(CurrentLevel); State = GameState.Game; }; events.OnGameStateChangeRequest += (state, mode) => { Mode = mode; State = state; }; events.OnRequestPauseState += (state) => { isPaused = state; events.OnEnactPauseState?.Invoke(isPaused); }; // Note that by default, we should make sure we don't have a visible pause menu. // Go through standard request line. events.OnRequestPauseState?.Invoke(false); }
public frm_Registers( DataGeneral dts ) { this._data = dts; InitializeComponent(); }
public frmLogIn( DataGeneral dts ) { this._data = dts; InitializeComponent(); }
public frm_Information( DataGeneral dts ) { this._data = dts; InitializeComponent(); }
// Returns how much the score changed by private DataEarnedScore CollectBubblesAsNecessary(bool impactsScore = true) { List <DataPoint> locs = new List <DataPoint>(); List <int> collectedIndexes = new List <int>(); // Collect collisions for (int i = bubbles.Count - 1; i >= 0; --i) { DataBubble bubble = bubbles[i]; // Determine if we're hitting float triggerRadius = bubble.AdjustedRadius(); bool isHit = Utils.IsLineTouchingCircle(lastLineStart, lastLineEnd, bubble.GetPosition(), triggerRadius, bubbleRadiusStandard); if (isHit) { collectedIndexes.Add(i); locs.Add(bubble.GetPosition()); } } // Score updating int hit = collectedIndexes.Count; int scoreBase = GameCore.pointsPerBubble * hit; int scoreBonus = 0; if (hit > 0) { ++linesDrawn; } if (hit > bonusThreshold) { int bonusHits = hit - bonusThreshold; scoreBonus = bonusHits * bonusHits * pointsPerBonusBubble; } DataEarnedScore dataEarnedScore = new DataEarnedScore(scoreBase, scoreBonus, locs); if (pointsPerBubble != 0) { DataGeneral gen = data.GetDataGeneral(); gen.score = gen.score + dataEarnedScore.total; if (impactsScore) { data.SetDataGeneral(gen); } } // Clear colleted bubbles. The indexes are from back to front, so the removal is safe. foreach (int index in collectedIndexes) { DataBubble bubble = bubbles[index]; events.OnBubbleDestroyed?.Invoke(bubble.GetPosition()); bubbles.RemoveAt(index); DataPoint[] newBubbles = DetermineSplits(bubble, lastLineStart, lastLineEnd); if (newBubbles != null) { foreach (DataPoint point in newBubbles) { DataBubble newBubble = new DataBubble(point, new DataPoint(0, 0), speed: 0, BubbleType.Standard); bubbles.Add(newBubble); } } } return(dataEarnedScore); }
public frmPrsRegisterStudent( DataGeneral dts ) { this._data = dts; InitializeComponent(); }
public frm_AssignMaterials( DataGeneral dts ) { this._data = dts; InitializeComponent(); }
public mdl_Materiales_nc( DataGeneral dts ) { this._data = dts; InitializeComponent(); }
public frmAlumno( DataGeneral dts ) { this._data = dts; InitializeComponent(); }
void OnSerializedDataChange(DataGeneral data) { SetData(data); }
public frm_Parents( DataGeneral dts ) { this._data = dts; InitializeComponent(); }
public void SetData(DataGeneral data) { string writeFile = SavePath() + statsFile; System.IO.File.WriteAllText(writeFile, data.ToString()); }
public frmReportar(DataGeneral dts) { this._data = dts; InitializeComponent(); }
public frmMatricula( DataGeneral dts ) { this._data = dts; InitializeComponent(); }