static float SetQuantityInABond(BondTypes bond, ElementData bonding_atom, GameObject current_atom) //TODO:Ezt kitenni statikus osztályba { ChemistAtomModell current_atom_modell = current_atom.GetComponent <ChemistAtomModell>(); if (bond.Equals(BondTypes.Covalent)) { //TODO:Megcsinálni a kovalens kötéshez return(LoadPeriodicTable.table[current_atom_modell.Index].valence - current_atom_modell.CovalentConectedAtomPc / (float)bonding_atom.valence); } else if (bond.Equals(BondTypes.Ionic)) { int current_atom_valence_electrons = current_atom.GetComponent <ChemistAtomModell>().ElectronCount; int bonding_atom_last_shell_index = bonding_atom.shells.Length; if (current_atom_valence_electrons < 8 && current_atom_valence_electrons > 0) { return((8 - current_atom_modell.ElectronCount) / (float)bonding_atom.shells[bonding_atom_last_shell_index - 1]); } else { return(0); } } else if (bond.Equals(BondTypes.Metalic)) { //TODO:Megcsinálni ide a fémes kötéshez tartozó cuccost } return(0); }
public void CreateChemistModell(int index, BondTypes bond) { float num = Random.Range(5, 10); GameObject Obj = Instantiate(chemistAtomModel, new Vector3(num, num, 0), Quaternion.identity); Obj.GetComponentInChildren <ChemistAtomModell>().symbol.text = LoadPeriodicTable.table[index].symbol; Obj.GetComponentInChildren <ChemistAtomModell>().LastShellPopulation = LoadPeriodicTable.table[index].shells[LoadPeriodicTable.table[index].shells.Length - 1]; Obj.GetComponentInChildren <ChemistAtomModell>().Index = index; Obj.GetComponentInChildren <ChemistAtomModell>().Bond = bond; }
/// <summary> /// /// </summary> /// <param name="bond">A Kötés tipusa</param> /// <param name="bonding_atom">Ezt az atomot akarom a bonddal</param> /// <param name="current_atom">Ehhez az atomhoz kötni, ő a fő atom</param> /// <returns></returns> static float SetQuantity(BondTypes bond, ElementData bonding_atom, ElementData current_atom) //TODO:Ezt kitenni statikus osztályba { if (bond.Equals(BondTypes.Covalent)) { //if (bonding_atom.valence > current_atom.valence) // return 0; //else return(current_atom.valence / (float)bonding_atom.valence); } else if (bond.Equals(BondTypes.Ionic)) { int current_atom_last_shell_index = current_atom.shells.Length; int bonding_atom_last_shell_index = bonding_atom.shells.Length; return((8 - current_atom.shells[current_atom_last_shell_index - 1]) / (float)bonding_atom.shells[bonding_atom_last_shell_index - 1]); } else if (bond.Equals(BondTypes.Metalic)) { //TODO:Megcsinálni ide a fémes kötéshez tartozó cuccost } return(0); }