public void lancerEvenement(Eve e)
    {
        // Debug.Log("EVENEMENT :"+e.name[0]);
        MethodInfo m = e.go.GetType().GetMethod(e.nameM [e.indiceM [0]]);

        if (e.enumParam[0] != System.TypeCode.DBNull)
        {
            object[] objectTemp = new object[1];
            switch (e.enumParam[0])
            {
            case System.TypeCode.Int32:
                objectTemp [0] = e.paramInt;
                break;

            case System.TypeCode.Boolean:
                objectTemp [0] = e.paramBool;
                break;
            }
            m.Invoke(e.go, objectTemp);
        }
        else
        {
            m.Invoke(e.go, null);
        }

        GameControl.control.StartCoroutine(timer(e));
    }
예제 #2
0
파일: Category.cs 프로젝트: Rogenator/Eve
 internal CategoryTree(Eve.Entity.Category cat)
     : base(cat)
 {
     this.Childs = new List<CategoryTree>();
     foreach (var c in cat.Category1)
         this.Childs.Add(new CategoryTree(c));
 }
예제 #3
0
    private void FileOpen(string pPath, List <Eve> pArrayEve)
    {
        string[]  arrStr = System.IO.File.ReadAllLines(@PATH);
        string[]  strArray;
        Eve       tempEvent;
        Condition tempCond;
        Action    tempAct;
        Sheath    tempSth;
        Boolean   tempBool;
        String    line;

        Debug.Log("Contents of WriteLines2.txt = ");
        for (int i = 0; i < arrStr.Length; i += 2)
        {
            line = arrStr[i];
            // Use a tab to indent each line of the file.
            Debug.Log("\t" + line);
            strArray = line.Split(' ');
            if (strArray[0] == "true")
            {
                tempBool = true;
            }
            else
            {
                tempBool = false;
            }

            tempCond  = new Condition(tempBool, float.Parse(strArray[POSITION_PROPERTY]));
            tempSth   = new Sheath(strArray[POSITION_NAME], arrStr[i + 1]);
            tempEvent = new Eve(tempCond, null, tempSth);
            arrayEve.Add(tempEvent);
        }
    }
예제 #4
0
파일: Company.cs 프로젝트: Rogenator/Eve
 internal Company(Eve.Entity.Company c)
 {
     this.CompanyDescription = c.CompanyDescription;
     this.CompanyId = c.CompanyId;
     this.CompanyIsActive = c.CompanyIsActive;
     this.CompanyLogo = c.CompanyLogo;
     this.CompanyName = c.CompanyName;
 }
예제 #5
0
파일: Category.cs 프로젝트: Rogenator/Eve
 internal Category(Eve.Entity.Category cat)
 {
     this.CategoryId = cat.CategoryId;
     this.ParentCategoryId = cat.ParentCategoryId;
     this.CategoryNameEn = cat.CategoryNameEn;
     this.CategoryNameEs = cat.CategoryNameEs;
     this.CategoryIsActive = cat.CategoryIsActive;
 }
예제 #6
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Day.GetHashCode();
         hashCode = (hashCode * 397) ^ Min.GetHashCode();
         hashCode = (hashCode * 397) ^ Max.GetHashCode();
         hashCode = (hashCode * 397) ^ Night.GetHashCode();
         hashCode = (hashCode * 397) ^ Eve.GetHashCode();
         hashCode = (hashCode * 397) ^ Morn.GetHashCode();
         return(hashCode);
     }
 }
    IEnumerator timer(Eve e)
    {
        for (var i = 0; i < 1; i++)
        {
            Debug.Log("WAIT FIN " + e.name[0]);
            yield return(new WaitWhile(() => e.go.evenementIsEnCours()));

            Debug.Log("UNWAIT" + e.name[0]);
        }
        index++;
        if (index < es.Count)
        {
            lancerEvenement(es[index]);
        }
    }
예제 #8
0
    public void StartEvent(int i)
    {
        Eve tempEv = arrayEve[i];

        messageCanvas.SetActive(true);
        messageCanvas.transform.Find("MessageEvent").GetComponent <Text>().text     = tempEv.getSheath().getName();
        messageCanvas.transform.Find("DescriptionEvent").GetComponent <Text>().text = tempEv.getSheath().getDescriprion();
        pausedControl.paused = true;
        p.evente();
        Debug.Log("WEOWEOWEOWEOWEOWEOWEOWOEOWE");
        run(i);
        EventTree et = new EventTree(eRoot, tempEv.getSheath().getName());

        eRoot.addChild(et);
    }
예제 #9
0
            public void Humans_can_reproduce_when_there_is_a_name_a_mother_and_a_father()
            {
                Adam   adam  = Adam.GetInstance();
                Eve    eve   = Eve.GetInstance(adam);
                Male   seth  = new Male("Seth", eve, adam);
                Female azura = new Female("Azura", eve, adam);
                Male   enos  = new Male("Enos", azura, seth);

                Assert.AreEqual("Eve", eve.Name);
                Assert.AreEqual("Adam", adam.Name);
                Assert.AreEqual("Seth", seth.Name);
                Assert.AreEqual("Azura", azura.Name);
                Assert.AreEqual("Enos", ((Human)enos).Name);
                Assert.AreEqual(seth, ((Human)enos).Father);
                Assert.AreEqual(azura, ((Human)enos).Mother);
            }
예제 #10
0
        public void Human_can_reproduce_when_they_have_a_mother_and_father_and_have_a_name()
        {
            var adam  = Adam.GetInstance();
            var eve   = Eve.GetInstance(adam);
            var seth  = new Male("Seth", eve, adam);
            var azura = new Female("Azura", eve, adam);
            var enos  = new Male("Enos", azura, seth);

            Assert.AreEqual("Eve", eve.Name);
            Assert.AreEqual("Adam", adam.Name);
            Assert.AreEqual("Seth", seth.Name);
            Assert.AreEqual("Azura", azura.Name);
            Assert.AreEqual("Enos", ((Human)enos).Name);
            Assert.AreEqual(seth, ((Human)enos).Father);
            Assert.AreEqual(azura, ((Human)enos).Mother);
        }
예제 #11
0
 public void TriggerDel()
 {
     foreach (var del in Eve.GetInvocationList())
     {
         try
         {
             //looks good!!!! but not good enough
             del.Method.Invoke("Delegate call, say Hello", null);
             Del("Delegate call");
         }
         catch (Exception e)
         {
             Console.WriteLine("Cathed Error!!!");
         }
     }
     ;
 }
예제 #12
0
    public void Eve_is_unique_and_created_from_a_rib_of_adam()
    {
        Adam adam       = Adam.GetInstance();
        Eve  eve        = Eve.GetInstance(adam);
        Eve  anotherEve = Eve.GetInstance(adam);

        Assert.IsTrue(eve is Eve);
        Assert.AreEqual(eve, anotherEve);

        // GetInstance() is the only static method on Eve
        Assert.AreEqual(1, typeof(Eve).GetMethods().Where(x => x.IsStatic).Count());

        // Eve has no public or internal constructor
        Assert.IsFalse(typeof(Eve).GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
                       .Any(x => x.IsPublic || x.IsAssembly));

        // Eve cannot be overridden
        Assert.IsTrue(typeof(Eve).IsSealed);
    }
예제 #13
0
    public void Father_and_mother_are_essential_for_reproduction()
    {
        // There is just 1 way to reproduce
        Assert.AreEqual(1, typeof(Male).GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
                        .Where(x => x.IsPublic || x.IsAssembly).Count());
        Assert.AreEqual(1, typeof(Female).GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).
                        Where(x => x.IsPublic || x.IsAssembly).Count());

        var adam = Adam.GetInstance();
        var eve  = Eve.GetInstance(adam);

        Assert.Throws <ArgumentNullException>(() => new Male("Seth", null, null));
        Assert.Throws <ArgumentNullException>(() => new Male("Abel", eve, null));
        Assert.Throws <ArgumentNullException>(() => new Male("Seth", null, adam));
        Assert.Throws <ArgumentNullException>(() => new Female("Azura", null, null));
        Assert.Throws <ArgumentNullException>(() => new Female("Awan", eve, null));
        Assert.Throws <ArgumentNullException>(() => new Female("Dina", null, adam));
        Assert.Throws <ArgumentNullException>(() => new Female("Eve", null, null));
        Assert.Throws <ArgumentNullException>(() => new Male("Adam", null, null));
    }
예제 #14
0
        private async Task <Tuple <DateTime, string> > GetRefTypeName(long id)
        {
            if (_referenceType == null)
            {
                var t      = new Eve().GetReferenceTypesAsync();
                var result = await t.ConfigureAwait(false);

                _referenceType = result.Result.RefTypes.ToList();
            }

            var refType = _referenceType.FirstOrDefault(x => x.RefTypeId == id);

            if (refType == null)
            {
                return(new Tuple <DateTime, string>(DateTime.UtcNow.AddYears(100), "<unknown>"));
            }
            else
            {
                return(new Tuple <DateTime, string>(DateTime.UtcNow.AddYears(100), refType.RefTypeName));
            }
        }
예제 #15
0
    public void StartGenerate(int i)
    {
        double r      = rnd.NextDouble();
        Eve    tempEv = arrayEve[i];

        if (tempEv.getCondition().getCond())
        {
            if (tempEv.getCondition().getProperty() > r)
            {
                Debug.Log("Random:" + r + " Name: " + tempEv.getSheath().getName() + " Property: " + tempEv.getCondition().getProperty());
                //GameObject newMC = (GameObject)GameObject.Instantiate(messageCanvas);
                messageCanvas.SetActive(true);
                messageCanvas.transform.Find("MessageEvent").GetComponent <Text>().text     = tempEv.getSheath().getName();
                messageCanvas.transform.Find("DescriptionEvent").GetComponent <Text>().text = tempEv.getSheath().getDescriprion();
                pausedControl.paused = true;
                p.evente();
                Debug.Log("WEOWEOWEOWEOWEOWEOWEOWOEOWE");
                run(i);
                EventTree et = new EventTree(eRoot, tempEv.getSheath().getName());
                eRoot.addChild(et);
            }
        }
    }
예제 #16
0
 public PhotonPlayer(bool isLocal, int actorID, string name)
 {
     texture_customObject = new Texture2D[2];
     url_customObject     = new string[2];
     pausedFlayer         = false;
     bytesFiled           = 0;
     SLBFiled             = false;
     CMFiled               = false;
     versionFiled          = string.Empty;
     propertyFiled         = string.Empty;
     RSFiled               = false;
     RCFiled               = false;
     versionRSFiled        = string.Empty;
     LockPlayerFiled       = false;
     this.actorID          = -1;
     this.nameField        = string.Empty;
     this.customProperties = new ExitGames.Client.Photon.Hashtable();
     this.isLocal          = isLocal;
     this.actorID          = actorID;
     this.nameField        = name;
     skin = new CyanSkin();
     eve  = new Eve();
 }
예제 #17
0
 public void Eve_is_a_human()
 {
     Console.WriteLine(Adam.GetInstance() is Human);
     Assert.IsTrue(Eve.GetInstance(Adam.GetInstance()) is Human);
 }
예제 #18
0
 protected bool Equals(Temp other)
 {
     return(Day.Equals(other.Day) && Min.Equals(other.Min) && Max.Equals(other.Max) && Night.Equals(other.Night) && Eve.Equals(other.Eve) && Morn.Equals(other.Morn));
 }
예제 #19
0
 public void Eve_is_a_female()
 {
     Assert.IsTrue(Eve.GetInstance(Adam.GetInstance()) is Female);
 }
예제 #20
0
 public void Eve_is_a_human()
 {
     Assert.IsTrue(Eve.GetInstance(Adam.GetInstance()) is Human);
 }
예제 #21
0
 public void Eve_can_only_be_create_of_a_rib_of_adam()
 {
     Assert.Throws <ArgumentNullException>(() => Eve.GetInstance(null));
 }