public static void Main()
    {
        // calling code
        var obj = new Obj1();

        Foo <Obj1>(obj);
    }
예제 #2
0
    public static void Main()
    {
        var obj = new Obj1();

        Foo <Obj1>(obj);
        Foo <Obj1>("");        // excepion
    }
예제 #3
0
        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
        }
예제 #4
0
 protected override void Write(ClientProcessor psr, NWriter wtr)
 {
     wtr.Write(Time);
     Position.Write(wtr);
     Obj1.Write(wtr);
     Obj2.Write(wtr);
 }
예제 #5
0
 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
    }
예제 #7
0
 public bool Equals(TestEntryFull other)
 {
     return
         (Tag == other.Tag
          &&
          Prop1 == other.Prop1
          &&
          Prop2 == other.Prop2
          &&
          Obj1.Equals(other.Obj1));
 }
예제 #8
0
    private void Start()
    {
        Anim = GetComponent <Animator>();

        if (Obj0 == true)
        {
            Obj0.SetActive(false);
        }
        if (Obj1 == true)
        {
            Obj1.SetActive(false);
        }
    }
예제 #9
0
        /// <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);
        }
예제 #10
0
 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));
 }
예제 #11
0
        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);
        }
예제 #12
0
        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);
        }
예제 #13
0
        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);
        }
예제 #14
0
        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);
        }
예제 #15
0
 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);
         }
     }
 }
예제 #16
0
        // 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();
        }
예제 #17
0
 public override string ToString()
 {
     return(string.Format("Obj1:{0} Obj2:{1} Status:{2}", Obj1.ToString() ?? string.Empty, Obj2.ToString() ?? string.Empty, Status)
            .Replace("\0", ""));
 }
예제 #18
0
 public static bool operator ==(Tupel <T1, T2> Obj1, Tupel <T1, T2> Obj2)
 {
     return(Obj1.Equals(Obj2));
 }
 public Obj1Wrapper(Obj1 obj)
 {
     this._obj = obj;
 }
예제 #20
0
    /// <summary>
    /// Spawna un Obj1 sulla posizione dello spawner
    /// </summary>
    public void SpawnObj1()
    {
        Obj1 obj = (manager.GetFirstAvaiableObject <Obj1>() as Obj1);

        obj.SetPosition(transform.position);
    }
예제 #21
0
        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
        }