コード例 #1
0
 void OnEnable()
 {
     gold     = false;
     aniDelay = 200;
     tooltip.SetActive(false);
     chimera                  = Chimera.GetInstance();
     passWheelFill            = passWheel.GetComponent <Image>();
     passWheelFill.fillAmount = 0;
     if (chimera.currState == Chimera.MainGameState.CardPick)
     {
         button.SetActive(true);
         float chance = RuneStats.GetInstance().GetRuneChance(Chimera.GetInstance().week, card);
         percentPassFail.SetActive(true);
         percentPassFail.GetComponent <Text>().text = "0%";
         if (chance > 1)
         {
             goldenWheel.SetActive(true);
             gold = true;
             percentPassFail.GetComponent <Text>().text = "100%";
         }
         else
         {
             goldenWheel.SetActive(false);
         }
         passFill = chance;
     }
     else
     {
         button.SetActive(false);
         gold = false;
     }
 }
コード例 #2
0
 // Start is called before the first frame update
 void Start()
 {
     mastermind = Chimera.GetInstance().mastermindScreen.GetComponent <Mastermind>();
     image      = transform.Find("Image").GetComponent <Image>();
     button     = GetComponent <Button>();
     SetMastermindColor(mastermind.colors[0]);
 }
コード例 #3
0
        public void InChimera()
        {
            const uint N       = 8;
            var        chimera = new Chimera <double>(10, 11, 0);

            Assert.Equal(chimera.InChimera, N);
            this.DisposeAndCheckDisposedState(chimera);
        }
コード例 #4
0
        public void Column()
        {
            const uint N       = 11;
            var        chimera = new Chimera <double>(10, 11, 0);

            Assert.Equal(chimera.Column, N);
            this.DisposeAndCheckDisposedState(chimera);
        }
コード例 #5
0
 void Awake()
 {
     chimera = Chimera.GetInstance();
     overlay = chimera.overlay.GetComponent <Overlay>();
     sfx     = SoundEffects.GetInstance();
     dialog  = chimera.chatScreen.GetComponent <DialogUI>();
     cam     = Camera.main.GetComponent <Animator>();
 }
コード例 #6
0
        public void Spins()
        {
            const uint N       = 880;
            var        chimera = new Chimera <double>(10, 11, 0);

            Assert.Equal(chimera.Spins, N);
            this.DisposeAndCheckDisposedState(chimera);
        }
コード例 #7
0
    // displays fly up screen
    public void ClickFactionButton(string faction)
    {
        flyUpPanel.SetActive(false);
        int week = Chimera.GetInstance().week;
        Dictionary <string, string> reqs = FactionRequests.GetInstance().GetFactionRequests(week);

        ShowFlyUp(reqs[faction], faction);
        Chimera.GetInstance().faction = faction;
    }
コード例 #8
0
        public void Can_outrun_chimera()
        {
            // Arrange
            Chimera creature = new Chimera();

            // Act
            Assert.False(creature.CanOutrun());

            // Assert
        }
コード例 #9
0
            public void SaveChimera(Chimera chimera)
            {
                using (DbConnection conn = GetConnection())
                    using (DbTransaction trans = conn.BeginTransaction())
                    {
                        foreach (PropertyInfo pi in typeof(Chimera).GetProperties())
                        {
                            using (DbCommand cmd = CreateTextCommand(conn, trans, "INSERT INTO DataVarbinaryMax (name, value) VALUES (@name, @value)"))
                            {
                                AddParameter(cmd, "@name", pi.Name);
                                if (pi.PropertyType == typeof(Int16))
                                {
                                    Int16 value = (Int16)pi.GetValue(chimera);
                                    Debug.Print("{0}", value);
                                    byte[] bytes = BitConverter.GetBytes(value);
                                    Debug.Print("{0}", BitConverter.ToString(bytes));
                                    Int16 value2 = BitConverter.ToInt16(bytes, 0);
                                    Debug.Print("{0}", value2);
                                    AddParameter(cmd, DbType.Binary, "@value", bytes);
                                    cmd.ExecuteNonQuery();
                                }
                                else if (pi.PropertyType == typeof(Int32))
                                {
                                    Int32 value = (Int32)pi.GetValue(chimera);
                                    Debug.Print("{0}", value);
                                    byte[] bytes = BitConverter.GetBytes(value);
                                    Debug.Print("{0}", BitConverter.ToString(bytes));
                                    Int32 value2 = BitConverter.ToInt32(bytes, 0);
                                    Debug.Print("{0}", value2);
                                    AddParameter(cmd, DbType.Binary, "@value", bytes);
                                    cmd.ExecuteNonQuery();
                                }
                            }
                        }

                        using (DbCommand cmd = CreateTextCommand(conn, trans, "SELECT value FROM DataVarbinaryMax WHERE name = 'Int16'"))
                            using (DbDataReader dr = cmd.ExecuteReader())
                            {
                                while (dr.Read())
                                {
                                    byte[] bytes = (byte[])dr["value"];
                                    Int16  value = BitConverter.ToInt16(bytes, 0);
                                    Debug.Print("{0}", value);
                                }
                            }

                        trans.Commit();
                    }
            }
コード例 #10
0
    public bool Success()
    {
        if (success)
        {
            List <Card> wonCard = new List <Card>();
            wonCard.Add(Spellbook.RandomCard());
            Chimera.GetInstance().cards.AddRange(Chimera.GetInstance().cardChooserScreen.GetComponent <RuneChoiceScreen>().AddRunes(wonCard));
            nextBtn.SetActive(true);
            winRune.SetActive(true);
            winRune.GetComponent <StoneCard>().Set(wonCard[0], false);
            helpBtn.SetActive(false);
        }

        return(success);
    }
コード例 #11
0
    // Start is called before the first frame update
    void OnEnable()
    {
        float week = Chimera.GetInstance().week;

        flyUpPanel.SetActive(false);
        nextBtn.SetActive(false);

        if (week == 1)
        {
            sunOrb.SetActive(false);
            nightOrb.SetActive(false);
            barkOrb.SetActive(false);
            oxOrb.SetActive(false);
        }
        else if (week == 2)
        {
            sunOrb.SetActive(true);
            nightOrb.SetActive(true);
            barkOrb.SetActive(false);
            oxOrb.SetActive(false);
        }
        else if (week == 8)
        {
            summerStone.sprite = brokenStone;
            sunOrb.SetActive(false);
            nightOrb.SetActive(false);
        }
        else if (week == 10)
        {
            deerOrb.SetActive(false);
            sunOrb.SetActive(false);
            nightOrb.SetActive(false);
            barkOrb.SetActive(false);
            oxOrb.SetActive(false);
        }
        else
        {
            summerStone.sprite = regularStone;
            wolfOrb.SetActive(true);
            deerOrb.SetActive(true);
            sunOrb.SetActive(true);
            nightOrb.SetActive(true);
            barkOrb.SetActive(true);
            oxOrb.SetActive(true);
        }
    }
コード例 #12
0
        public void Foo()
        {
            Random             random      = new Random();
            Chimera            chimera     = new Chimera();
            ChimeraDataManager dataManager = new ChimeraDataManager();

            Type type = chimera.GetType();

            Debug.Print("{0}", type.FullName);

            foreach (PropertyInfo pi in type.GetProperties())
            {
                Debug.Print("{0} ({1}) {2} = {3}", pi.PropertyType.Name, Marshal.SizeOf(pi.GetValue(chimera)), pi.Name, pi.GetValue(chimera));
            }

            dataManager.SaveChimera(chimera);
        }
コード例 #13
0
ファイル: GridRendering.cs プロジェクト: vshafran/Wander
    private void RenderTile(Chimera.ChimeraNode node)
    {
        float cX = node.x;
        float cY = node.y;

        lineMaterial.SetPass( 0 );
        GL.Begin( GL.LINES );

        if (node.a == 0 && node.b == 0)
        {
            GL.Color(Color.red);
        }
        else
        {
            GL.Color( Color.green );
        }
        /////////////////
        ChimeraPixelsToWorldPoint InternalPoint = (float x, float y, float z) =>
        {
            Vector3 point = new Vector3(x,y,z);
            Vector3 transformPoint = Camera.main.ScreenToWorldPoint(point);
            transformPoint *= ChimeraWorld.rescaler;
            transformPoint.z = 0;
            return transformPoint;
        };

        GL.Vertex(InternalPoint(cX - wCell/2, cY, 0));
        GL.Vertex(InternalPoint(cX, cY - hCell/2, 0));

        GL.Vertex(InternalPoint(cX, cY - hCell/2, 0));
        GL.Vertex(InternalPoint(cX + wCell/2, cY, 0));

        GL.Vertex(InternalPoint(cX + wCell/2, cY, 0));
        GL.Vertex(InternalPoint(cX, cY + hCell/2, 0));

        GL.Vertex(InternalPoint(cX, cY + hCell/2, 0));
        GL.Vertex(InternalPoint(cX - wCell/2, cY, 0));

        GL.End();
    }
コード例 #14
0
 // Start is called before the first frame update
 void Start()
 {
     dialogSprites = DialogSprites.GetInstance();
     chimera       = Chimera.GetInstance();
 }
コード例 #15
0
ファイル: AdminUser.cs プロジェクト: ripple182/ChimeraCMS
 /// <summary>
 /// Simply add an admin user to the session.
 /// </summary>
 /// <param name="request">The request.</param>
 /// <param name="adminuser">The admin user to add.</param>
 private static void AddToSession(HttpRequestBase request, Chimera.Entities.Admin.AdminUser adminuser)
 {
     request.RequestContext.HttpContext.Session[SESSION_KEY] = adminuser;
 }
コード例 #16
0
 // Start is called before the first frame update
 void Start()
 {
     mastermind = Chimera.GetInstance().mastermindScreen.GetComponent <Mastermind>();
     image      = transform.Find("Image").GetComponent <Image>();
 }
コード例 #17
0
 // Start is called before the first frame update
 void Start()
 {
     mastermind = Chimera.GetInstance().mastermindScreen.GetComponent <Mastermind>();
 }
コード例 #18
0
ファイル: GridRendering.cs プロジェクト: vshafran/Wander
 public void DrawNode(Chimera.ChimeraNode node)
 {
 }
コード例 #19
0
        public void Create()
        {
            var chimera = new Chimera <double>(10, 10);

            this.DisposeAndCheckDisposedState(chimera);
        }
コード例 #20
0
 public ConstrainedAxisPanel(Chimera.Plugins.ConstrainedAxis constrainedAxis)
     : this()
 {
     Axis = constrainedAxis;
 }