public static void Main() { // calling code var obj = new Obj1(); Foo <Obj1>(obj); }
public static void Main() { var obj = new Obj1(); Foo <Obj1>(obj); Foo <Obj1>(""); // excepion }
private void lancement_Click(object sender, EventArgs e) { lancement.Hide(); foreach (Joueur j in listeJoueur) { j.piocher(pioche); } jEnCours = 0; groupBoxAction.Show(); groupBoxObjectif.Show(); #region Etang baseDessin.DrawRectangle(contour, tableauParcelle[4, 4].dimension); baseDessin.FillRectangle(tableauParcelle[4, 4].remplissage, tableauParcelle[4, 4].dimension); tableauParcelle[4, 4].afficher = true; #endregion #region objectif du premier joueur Obj1.Text = listeJoueur[jEnCours].main[0].objectif; Obj1.Show(); #endregion #region estomac du panda estomacJaune.Text = "0"; estomacRose.Text = "0"; estomacVert.Text = "0"; estomacPanda.Show(); #endregion #region panda et jardinier baseDessin.DrawImage(jardinier.image, jardinier.placement); baseDessin.DrawImage(panda.image, panda.placement); #endregion }
protected override void Write(ClientProcessor psr, NWriter wtr) { wtr.Write(Time); Position.Write(wtr); Obj1.Write(wtr); Obj2.Write(wtr); }
protected override void Write(NWriter wtr) { wtr.Write(Time); Position.Write(wtr); Obj1.Write(wtr); Obj2.Write(wtr); }
public static void Main() { var obj = new Obj1(); Foo <Obj1>(obj); System.Console.WriteLine("${0} at ${1}/hr.", obj.Cost, obj.Rate); // Foo<Obj1>(""); // ArgumentException }
public bool Equals(TestEntryFull other) { return (Tag == other.Tag && Prop1 == other.Prop1 && Prop2 == other.Prop2 && Obj1.Equals(other.Obj1)); }
private void Start() { Anim = GetComponent <Animator>(); if (Obj0 == true) { Obj0.SetActive(false); } if (Obj1 == true) { Obj1.SetActive(false); } }
/// <summary> /// Checks that two objects are equal. /// </summary> /// <param name="obj1">The first object.</param> /// <param name="obj2">The second object.</param> public bool VerifyEqual(IEqualComparable obj1, IEqualComparable obj2) { Contract.RequireNotNull(obj1, out IEqualComparable Obj1); Contract.RequireNotNull(obj2, out IEqualComparable Obj2); bool Result; if (!ComparedObjectList.ContainsKey(Obj1)) { ComparedObjectList.Add(Obj1, false); } else if (!ComparedObjectList.ContainsKey(Obj2)) { ComparedObjectList.Add(Obj2, false); } else { Result = true; if (ComparisonCount == FailIndex) { return(false); } ComparisonCount++; return(Result); } if (Obj1.IsEqual(this, Obj2)) { Result = true; } else if (CanReturnFalse) { Result = false; } else { Result = false; // For breakpoints. } if (ComparisonCount == FailIndex) { return(false); } ComparisonCount++; return(Result); }
public static bool operator !=(Tupel <T1, T2> Obj1, Tupel <T1, T2> Obj2) { if (object.ReferenceEquals(Obj1, null)) { if (object.ReferenceEquals(Obj2, null)) { return(false); } return(true); } if (object.ReferenceEquals(Obj2, null)) { return(true); } return(!Obj1.Equals(Obj2)); }
private void openToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog fd = new OpenFileDialog(); fd.Filter = "All Majiro Scripts|*.mjo"; if (fd.ShowDialog() != DialogResult.OK) { return; } Script = new Obj1(File.ReadAllBytes(fd.FileName)); string[] Strings = Script.Import(); listBox1.Items.Clear(); listBox1.Items.AddRange(Strings); }
public void It_ShouldReturnAnObjectIdentical() { var objToClone = new Obj1 { S = "some string", D = DateTime.Now, O = new Obj2 { I = 4, B = true } }; Obj1 result = objToClone.Clone(); result.Should().BeEquivalentTo(objToClone); }
public async Task It_ShouldReturnAnObjectIdenticalFromTask() { Task <Obj1> objToClone = Task.FromResult( new Obj1 { S = "some string", D = DateTime.Now, O = new Obj2 { I = 4, B = true } } ); Obj1 result = await objToClone.CloneAsync(); result.Should().BeEquivalentTo(await objToClone); }
public void It_ShouldProduceAnImmutableObject() { var objToClone = new Obj1 { S = "some string", D = DateTime.Now, O = new Obj2 { I = 4, B = true } }; Obj1 result = objToClone.Clone(); objToClone.O.I = 5; result.Should().NotBeEquivalentTo(objToClone); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("Player")) { Activated = true; if (Act.isPlaying == false) { Act.Play(); } if (Obj0 == true) { Obj0.SetActive(true); } if (Obj1 == true) { Obj1.SetActive(true); } } }
// Affiche le nom du joueur qui doit faire effectuer son tour ainsi que ses objectifs public void Tour() { validationObj(); Obj2.Hide(); Obj3.Hide(); Obj1.Hide(); Obj4.Hide(); Obj5.Hide(); nbreobjok.Text = listeJoueur[jEnCours].nbreObjOk.ToString(); act = Action.Indefinie; MessageBox.Show("C'est à " + listeJoueur[jEnCours].nom + " de jouer."); if (listeJoueur[jEnCours].main.Count() >= 1) { Obj1.Text = listeJoueur[jEnCours].main[0].objectif; Obj1.Show(); } if (listeJoueur[jEnCours].main.Count() >= 2) { Obj2.Text = listeJoueur[jEnCours].main[1].objectif; Obj2.Show(); } if (listeJoueur[jEnCours].main.Count() >= 3) { Obj3.Text = listeJoueur[jEnCours].main[2].objectif; Obj3.Show(); } if (listeJoueur[jEnCours].main.Count() >= 4) { Obj4.Text = listeJoueur[jEnCours].main[3].objectif; Obj4.Show(); } if (listeJoueur[jEnCours].main.Count() >= 5) { Obj5.Text = listeJoueur[jEnCours].main[4].objectif; Obj5.Show(); } estomacJaune.Text = listeJoueur[jEnCours].nbreBambouJaune.ToString(); estomacRose.Text = listeJoueur[jEnCours].nbreBambouRose.ToString(); estomacVert.Text = listeJoueur[jEnCours].nbreBambouVert.ToString(); }
public override string ToString() { return(string.Format("Obj1:{0} Obj2:{1} Status:{2}", Obj1.ToString() ?? string.Empty, Obj2.ToString() ?? string.Empty, Status) .Replace("\0", "")); }
public static bool operator ==(Tupel <T1, T2> Obj1, Tupel <T1, T2> Obj2) { return(Obj1.Equals(Obj2)); }
public Obj1Wrapper(Obj1 obj) { this._obj = obj; }
/// <summary> /// Spawna un Obj1 sulla posizione dello spawner /// </summary> public void SpawnObj1() { Obj1 obj = (manager.GetFirstAvaiableObject <Obj1>() as Obj1); obj.SetPosition(transform.position); }
public Bambouseraie(ArrayList joueurs, int nbrej) { InitializeComponent(); baseDessin = zoneJardin.CreateGraphics(); #region Initialisation du tableau contenant les parcelles nbreParcelle = zoneJardin.Height / tailleParcelle; tableauParcelle = new Parcelle[nbreParcelle, nbreParcelle]; int xParcelle = 0; int yParcelle = 0; int ligne = 0; int colonne = 0; for (xParcelle = 0; xParcelle < zoneJardin.Height; xParcelle += (tailleParcelle + 1)) { for (yParcelle = 0; yParcelle < zoneJardin.Height; yParcelle += (tailleParcelle + 1)) { tableauParcelle[ligne, colonne] = new Parcelle(ligne, colonne, xParcelle, yParcelle, tailleParcelle); ligne++; } ligne = 0; colonne++; } #endregion #region Initialisation affichage objectif Obj1.Hide(); Obj2.Hide(); Obj3.Hide(); Obj4.Hide(); Obj5.Hide(); #endregion #region Intialisation de la pioche int maxPioche = nbrej * 6 + 10; piocheP = new List <Carte>(); Random rand = new Random(); for (int i = 0; i < maxPioche; i++) { pioche.Add(new Carte(rand.Next(1, 4))); } #endregion #region Initialisation du tableau des joueurs nbrejoueur = nbrej; listeJoueur = (Joueur[])joueurs.ToArray(typeof(Joueur)); #endregion #region Définition de l'étang tableauParcelle[4, 4].etang = true; tableauParcelle[4, 4].irriguee = true; tableauParcelle[4, 4].jardinier = true; tableauParcelle[4, 4].panda = true; tableauParcelle[4, 4].choixCouleur(Color.Blue); #endregion #region Initialisation des pinceaux contour = new Pen(Color.Black); police = new Font("Arial", 20); formatTexte = new StringFormat(); formatTexte.Alignment = StringAlignment.Center; formatTexte.LineAlignment = StringAlignment.Center; #endregion #region Définition des images string dossierimg = "C:/Users/Alice/Documents/Visual Studio 2013/Projects/Takenoko/TakenokoVisuel/img/"; jardinier = new Acteur(dossierimg + "jardinier.png", tableauParcelle[4, 4].dimension.X, tableauParcelle[4, 4].dimension.Y, tableauParcelle[4, 4], tailleInformation); int xpanda = tableauParcelle[4, 4].dimension.X + tailleParcelle - tailleInformation; panda = new Acteur(dossierimg + "panda.png", xpanda, tableauParcelle[4, 4].dimension.Y, tableauParcelle[4, 4], tailleInformation); #endregion }