Ejemplo n.º 1
0
Archivo: Program.cs Proyecto: sgww/cozy
        static void Main(string[] args)
        {
            ICozyGodEngine engine = new CozyGodEngine();

            engine.Init();

            ICraft       i   = engine.GetCraft();
            Card         a   = null;
            Card         b   = null;
            ICardLibrary lib = engine.GetCardLibrary();


            while (true)
            {
                string   input     = System.Console.ReadLine();
                string[] craftCard = input.Split(',');
                if (craftCard.Length < 2)
                {
                    System.Console.WriteLine("Input Error, \"name,name\"");
                    continue;
                }
                a = lib.FindCardByName(craftCard[0]);
                b = lib.FindCardByName(craftCard[1]);
                if (a != null && b != null)
                {
                    System.Console.Write("card : {0}, level : {1} + card : {2}, card level : {3} = "
                                         , a.Name, a.Level, b.Name, b.Level);
                }
                else
                {
                    System.Console.Write("Some card has no fond.");
                    continue;
                }
                Card cardRet = null;
                if (i.TryCraft(a, b))
                {
                    cardRet = i.Craft(a, b);
                }
                else
                {
                    System.Console.WriteLine("null");
                    continue;
                }
                System.Console.WriteLine("card : {0}, level : {1}", cardRet.Name, cardRet.Level);
            }
        }
Ejemplo n.º 2
0
        public void Init()
        {
            config = new GameConfigImpl();

            string contextPath;
            if (!config.TryGetStringConfig(StringConfigEnum.ContentPath, out contextPath))
            {
                return;
            }

            cardLibrary = new CardLibraryImpl(contextPath + "/Data/card.json");

            var c = new CraftImpl();
            c.Init(this);
            craft = c;

            var raf = new RaffleImpl();
            raf.Init(this);
            raffle = raf;
        }
Ejemplo n.º 3
0
 public bool Init(ICozyGodEngine engine)
 {
     bool bRet = false;
     do
     {
         m_engine = engine;
         mCL = engine.GetCardLibrary();
         if (mCL == null)
         {
             break;
         }
         LoadRaffleProbabilityArray();
         if (m_raffleProbabilityArray == null)
         {
             break;
         }
         bRet = true;
     } while (false);
     return bRet;
 }
Ejemplo n.º 4
0
        public bool Init(ICozyGodEngine engine)
        {
            mEngine = engine;
            mCL     = engine.GetCardLibrary();

            string contentPath;
            if(!engine.GetConfig().TryGetStringConfig(StringConfigEnum.ContentPath, out contentPath))
            {
                return false;
            }

            mFilePath = contentPath  + @"\Data\CraftTableConfig.txt";
            bool bRet = true;
            LoadCraftTable();
            if (m_CraftTableList==null)
            {
                bRet = false;
            }

            return bRet;
        }
Ejemplo n.º 5
0
        public bool Init(ICozyGodEngine engine)
        {
            bool bRet = false;

            do
            {
                m_engine = engine;
                mCL      = engine.GetCardLibrary();
                if (mCL == null)
                {
                    break;
                }
                LoadRaffleProbabilityArray();
                if (m_raffleProbabilityArray == null)
                {
                    break;
                }
                bRet = true;
            } while (false);
            return(bRet);
        }
Ejemplo n.º 6
0
Archivo: Program.cs Proyecto: sgww/cozy
        static void Main()
        {
            ICozyGodEngine engine = new CozyGodEngine();

            engine.Init();
            ICardLibrary cards = engine.GetCardLibrary();
            var          lib   = cards.Get();

            for (int i = 0; i < lib.Cards.Length; ++i)
            {
                Console.WriteLine("Level : " + i);
                Console.WriteLine("Count : " + (lib.Cards[i] == null ? 0 : lib.Cards[i].Count));
                if (lib.Cards[i] != null)
                {
                    foreach (var card in lib.Cards[i])
                    {
                        Console.WriteLine(card.Name + " " + card.CN_Name);
                    }
                }
            }
            Console.ReadKey();
        }
Ejemplo n.º 7
0
        public void Init()
        {
            config = new GameConfigImpl();

            string contextPath;

            if (!config.TryGetStringConfig(StringConfigEnum.ContentPath, out contextPath))
            {
                return;
            }

            cardLibrary = new CardLibraryImpl(contextPath + "/Data/card.json");

            var c = new CraftImpl();

            c.Init(this);
            craft = c;

            var raf = new RaffleImpl();

            raf.Init(this);
            raffle = raf;
        }
Ejemplo n.º 8
0
        public bool Init(ICozyGodEngine engine)
        {
            mEngine = engine;
            mCL     = engine.GetCardLibrary();

            string contentPath;

            if (!engine.GetConfig().TryGetStringConfig(StringConfigEnum.ContentPath, out contentPath))
            {
                return(false);
            }

            mFilePath = contentPath + @"\Data\CraftTableConfig.txt";
            bool bRet = true;

            LoadCraftTable();
            if (m_CraftTableList == null)
            {
                bRet = false;
            }

            return(bRet);
        }
Ejemplo n.º 9
0
 public DeckConverter(ICardLibrary cardLibrary)
 {
     this.cardLibrary = cardLibrary;
 }