Esempio n. 1
0
        public Dialogs(GameClient game)
        {
            _game = game;
            DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(DialogsData));
            string dialogfilename = game.Dialog;

#if !LIBWINDBOT
            using (FileStream fs = File.OpenRead("Dialogs/" + dialogfilename + ".json"))
#else
            using (FileStream fs = File.OpenRead(Path.Combine(WindBot.AssetPath, "Dialogs/", dialogfilename + ".json")))
#endif
            {
                DialogsData data = (DialogsData)serializer.ReadObject(fs);
                _welcome             = data.welcome;
                _deckerror           = data.deckerror;
                _duelstart           = data.duelstart;
                _newturn             = data.newturn;
                _endturn             = data.endturn;
                _directattack        = data.directattack;
                _attack              = data.attack;
                _ondirectattack      = data.ondirectattack;
                _facedownmonstername = data.facedownmonstername;
                _activate            = data.activate;
                _summon              = data.summon;
                _setmonster          = data.setmonster;
                _chaining            = data.chaining;
            }
        }
Esempio n. 2
0
        public Dialogs(GameClient game)
        {
            _game = game;
            DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(DialogsData));
            string dialogfilename = game.Dialog;

            using (FileStream fs = File.OpenRead("Dialogs/" + dialogfilename + ".json"))
            {
                DialogsData data = (DialogsData)serializer.ReadObject(fs);
                _welcome             = data.welcome;
                _deckerror           = data.deckerror;
                _duelstart           = data.duelstart;
                _newturn             = data.newturn;
                _endturn             = data.endturn;
                _directattack        = data.directattack;
                _attack              = data.attack;
                _ondirectattack      = data.ondirectattack;
                _facedownmonstername = data.facedownmonstername;
                _activate            = data.activate;
                _summon              = data.summon;
                _setmonster          = data.setmonster;
                _chaining            = data.chaining;
                _choiceadd           = data.choiceadd;
                _choiceselect        = data.choiceselect;
                _counter             = data.counter;
                _rps        = data.rps;
                _rpswin     = data.rpswin;
                _tribute    = data.tribute;
                _bosssummon = data.bosssummon;
            }
        }
Esempio n. 3
0
        public Dialogs(GameClient game)
        {
            this.game = game;
            DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(DialogsData));
            string dialogfilename = game.Dialog;

            using (FileStream fs = File.OpenRead("Dialogs/" + dialogfilename + ".json"))
            {
                DialogsData data = (DialogsData)serializer.ReadObject(fs);
                this.welcome = data.Welcome ?? new string[1] {
                    ""
                };
                this.deckError = data.DeckError ?? new string[1] {
                    ""
                };;
                this.duelStart = data.DuelStart ?? new string[1] {
                    ""
                };;
                this.newTurn = data.NewTurn ?? new string[1] {
                    ""
                };;
                this.endTurn = data.EndTurn ?? new string[1] {
                    ""
                };;
                this.directAttack = data.DirectAttack ?? new string[1] {
                    ""
                };;
                this.attack = data.Attack ?? new string[1] {
                    ""
                };;
                this.onDirectAttack = data.OnDirectAttack ?? new string[1] {
                    ""
                };;
                this.facedownMonsterName = data.FacedownMonsterName ?? "";
                this.activate            = data.Activate ?? new string[1] {
                    ""
                };;
                this.summon = data.Summon ?? new string[1] {
                    ""
                };;
                this.setMonster = data.SetMonster ?? new string[1] {
                    ""
                };;
                this.chaining = data.Chaining ?? new string[1] {
                    ""
                };;
            }
        }
Esempio n. 4
0
        public Dialogs(string dialogfilename, Action <string, bool> chat, string path)
        {
            Chat = chat;
            DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(DialogsData));

            using (FileStream fs = File.OpenRead(Path.Combine(path, "Dialogs/", dialogfilename + ".json")))
            {
                DialogsData data = (DialogsData)serializer.ReadObject(fs);
                _welcome             = data.welcome;
                _deckerror           = data.deckerror;
                _duelstart           = data.duelstart;
                _newturn             = data.newturn;
                _endturn             = data.endturn;
                _directattack        = data.directattack;
                _attack              = data.attack;
                _ondirectattack      = data.ondirectattack;
                _facedownmonstername = data.facedownmonstername;
                _activate            = data.activate;
                _summon              = data.summon;
                _setmonster          = data.setmonster;
                _chaining            = data.chaining;
            }
        }
Esempio n. 5
0
        public Dialogs(GameClient game)
        {
            _game = game;
            DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(DialogsData));
            string dialogfilename = game.Dialog;

            using (FileStream fs = Program.ReadFile("Dialogs", dialogfilename, "json"))
            {
                DialogsData data = (DialogsData)serializer.ReadObject(fs);
                _welcome             = data.welcome;
                _deckerror           = data.deckerror;
                _duelstart           = data.duelstart;
                _newturn             = data.newturn;
                _endturn             = data.endturn;
                _directattack        = data.directattack;
                _attack              = data.attack;
                _ondirectattack      = data.ondirectattack;
                _facedownmonstername = data.facedownmonstername;
                _activate            = data.activate;
                _summon              = data.summon;
                _setmonster          = data.setmonster;
                _chaining            = data.chaining;
            }
        }