当前位置: 首页>>代码示例>>C#>>正文


C# StreamWriter.WriteQuery方法代码示例

本文整理汇总了C#中System.IO.StreamWriter.WriteQuery方法的典型用法代码示例。如果您正苦于以下问题:C# StreamWriter.WriteQuery方法的具体用法?C# StreamWriter.WriteQuery怎么用?C# StreamWriter.WriteQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.StreamWriter的用法示例。


在下文中一共展示了StreamWriter.WriteQuery方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CompareEquip

        private bool CompareEquip()
        {
            using (StreamWriter writer = new StreamWriter("creature_equip_template.sql", true))
            {
                writer.WriteLine(string.Format("-- Dump of {0}", DateTime.Now));

                int counts = _equipments.Count;

                for (int i = 0; i < counts; ++i)
                {
                    EquipmentTemplate equipment = _equipments[i];
                    EquipmentTemplate sniffEquipment = _sniffEquipments[i];

                    for (int j = 0; j < 3; ++j)
                    {
                        if (!Equals(equipment.equipEntry[j], sniffEquipment.equipEntry[j]))
                            writer.WriteQuery("equipEntry" + (j + 1), equipment.equipEntry[j], equipment.entry);
                    }

                    if (i == (counts - 1))
                        Console.WriteLine("==========|| {0,-11}|| {1,-13}|| {2,-21}|| {3}||", counts, Generic.BadQuery,
                                          Generic.TableName, (Generic.BadQuery/(float) counts)*100);
                }

                writer.Flush();
            }

            return false;
        }
开发者ID:Lordron,项目名称:TableComparator,代码行数:29,代码来源:Program.cs

示例2: CompareGameObject

        private bool CompareGameObject()
        {
            using (StreamWriter writer = new StreamWriter("gameobject_template.sql", true))
            {
                writer.WriteLine(string.Format("-- Dump of {0}", DateTime.Now));

                int counts = _sniffGameObjects.Count;

                for (int i = 0; i < counts; ++i)
                {
                    GameobjectTemplate gameObject = _gameObjects[i];
                    GameobjectTemplate sniffGameObject = _sniffGameObjects[i];
                    uint entry = gameObject.entry;

                    if (!Equals(gameObject.faction, sniffGameObject.faction))
                        writer.WriteQuery("faction", gameObject.faction, entry);

                    if (!Equals(gameObject.flags, sniffGameObject.flags))
                        writer.WriteQuery("flags", gameObject.flags, entry);

                    if (i == (counts - 1))
                        Console.WriteLine("==========|| {0,-11}|| {1,-13}|| {2,-21}|| {3}||", counts, Generic.BadQuery,
                                          Generic.TableName, (Generic.BadQuery/(float) counts)*100);
                }

                writer.Flush();
            }

            return false;
        }
开发者ID:Lordron,项目名称:TableComparator,代码行数:30,代码来源:Program.cs

示例3: CreatureCompare

        private bool CreatureCompare()
        {
            using (StreamWriter writer = new StreamWriter("creature_template.sql", true))
            {
                writer.WriteLine(string.Format("-- Dump of {0}", DateTime.Now));

                int counts = _sniffCreatures.Count;

                for (int i = 0; i < counts; ++i)
                {
                    CreatureTemplate creature = _creatures[i];
                    CreatureTemplate sniffCreature = _sniffCreatures[i];
                    uint entry = sniffCreature.entry;

                    if (!Equals(creature.speed_run, sniffCreature.speed_run))
                        writer.WriteQuery("speed_run", sniffCreature.speed_run, entry);

                    if (!Equals(creature.speed_walk, sniffCreature.speed_walk))
                        writer.WriteQuery("speed_walk", sniffCreature.speed_walk, entry);

                    if (!Equals(creature.vehicleId, sniffCreature.vehicleId))
                        writer.WriteQuery("vehicle_id", sniffCreature.vehicleId, entry);

                    if (!Equals(creature.unit_class, sniffCreature.unit_class))
                        writer.WriteQuery("unit_class", sniffCreature.unit_class, entry);

                    if (!Equals(creature.unit_flag, sniffCreature.unit_flag))
                        writer.WriteQuery("unit_flags", sniffCreature.unit_flag, entry);

                    if (!Equals(creature.faction, sniffCreature.faction))
                        writer.WriteQuery("faction_A", "faction_H", sniffCreature.faction, entry);

                    if (!Equals(creature.dynamicFlags, sniffCreature.dynamicFlags))
                        writer.WriteQuery("dynamicflags", sniffCreature.dynamicFlags, entry);

                    if (!Equals(creature.scale, sniffCreature.scale))
                        writer.WriteQuery("scale", sniffCreature.scale, entry);

                    if (!Equals(creature.maxDamage, sniffCreature.maxDamage))
                        writer.WriteQuery("maxdmg", sniffCreature.maxDamage, entry);

                    if (!Equals(creature.minDamage, sniffCreature.minDamage))
                        writer.WriteQuery("mindmg", sniffCreature.minDamage, entry);

                    if (!Equals(creature.dmgMultiplier, sniffCreature.dmgMultiplier))
                        writer.WriteQuery("dmg_multiplier", sniffCreature.dmgMultiplier, entry);

                    if (!Equals(creature.attackPower, sniffCreature.attackPower))
                        writer.WriteQuery("attackpower", sniffCreature.attackPower, entry);

                    if (!Equals(creature.rangeAttackPower, sniffCreature.rangeAttackPower))
                        writer.WriteQuery("rangedattackpower", sniffCreature.rangeAttackPower, entry);

                    if (!Equals(creature.rangeAttackTime, sniffCreature.rangeAttackTime))
                        writer.WriteQuery("rangeattacktime", sniffCreature.rangeAttackTime, entry);

                    if (!Equals(creature.baseAttackTime, sniffCreature.baseAttackTime))
                        writer.WriteQuery("baseattacktime", sniffCreature.baseAttackTime, entry);

                    if (i == (counts - 1))
                        Console.WriteLine("==========|| {0,-11}|| {1,-13}|| {2,-21}|| {3}||", counts, Generic.BadQuery,
                                          Generic.TableName, (Generic.BadQuery/(float) counts)*100);
                }

                writer.Flush();
            }

            return false;
        }
开发者ID:Lordron,项目名称:TableComparator,代码行数:69,代码来源:Program.cs

示例4: CompareModel

        private bool CompareModel()
        {
            using (StreamWriter writer = new StreamWriter("creature_model_info.sql", true))
            {
                writer.WriteLine(string.Format("-- Dump of {0}", DateTime.Now));

                int counts = _sniffModels.Count;

                for (int i = 0; i < counts; ++i)
                {
                    ModelInfo model = _models[i];
                    ModelInfo sniffModel = _sniffModels[i];
                    uint modelId = model.modelid;

                    if (!Equals(model.bounding_radius, sniffModel.bounding_radius))
                        writer.WriteQuery("bounding_radius", sniffModel.bounding_radius, modelId);

                    if (!Equals(model.combat_reach, sniffModel.combat_reach))
                        writer.WriteQuery("combat_reach", sniffModel.combat_reach, modelId);

                    if (!Equals(model.gender, sniffModel.gender))
                        writer.WriteQuery("gender", sniffModel.gender, modelId);

                    if (i == (counts - 1))
                        Console.WriteLine("==========|| {0,-11}|| {1,-13}|| {2,-21}|| {3}||", counts, Generic.BadQuery,
                                          Generic.TableName, (Generic.BadQuery/(float) counts)*100);
                }

                writer.Flush();
            }

            return false;
        }
开发者ID:Lordron,项目名称:TableComparator,代码行数:33,代码来源:Program.cs


注:本文中的System.IO.StreamWriter.WriteQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。