forked from BAndysc/WoWDatabaseEditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQueryGeneratorTester.cs
102 lines (97 loc) · 3.49 KB
/
QueryGeneratorTester.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
using System.Numerics;
using WDE.Common.Database;
using WDE.QueryGenerators.Base;
using WDE.QueryGenerators.Models;
using WDE.SqlQueryGenerator;
namespace DatabaseTester;
public class QueryGeneratorTester
{
private readonly IQueryGenerator<CreatureSpawnModelEssentials> creature;
private readonly IQueryGenerator<GameObjectSpawnModelEssentials> gameobject;
private readonly IQueryGenerator<ISpawnGroupTemplate> spawnGroupTemplate;
private readonly IQueryGenerator<ISpawnGroupSpawn> spawnGroupSpawn;
private readonly IQueryGenerator<QuestChainDiff> questChain;
private readonly IQueryGenerator<CreatureDiff> creatureDiff;
private readonly IQueryGenerator<GameObjectDiff> gameobjectDiff;
public QueryGeneratorTester(IQueryGenerator<CreatureSpawnModelEssentials> creature,
IQueryGenerator<GameObjectSpawnModelEssentials> gameobject,
IQueryGenerator<ISpawnGroupTemplate> spawnGroupTemplate,
IQueryGenerator<ISpawnGroupSpawn> spawnGroupSpawn,
IQueryGenerator<QuestChainDiff> questChain,
IQueryGenerator<CreatureDiff> creatureDiff,
IQueryGenerator<GameObjectDiff> gameobjectDiff)
{
this.creature = creature;
this.gameobject = gameobject;
this.spawnGroupTemplate = spawnGroupTemplate;
this.spawnGroupSpawn = spawnGroupSpawn;
this.questChain = questChain;
this.creatureDiff = creatureDiff;
this.gameobjectDiff = gameobjectDiff;
}
public IEnumerable<string?> Tables()
{
yield return creature.TableName;
yield return gameobject.TableName;
yield return spawnGroupTemplate.TableName;
yield return spawnGroupSpawn.TableName;
}
public IEnumerable<IQuery?> Generate()
{
yield return creature.Insert(new CreatureSpawnModelEssentials()
{
Guid = int.MaxValue - 1
});
yield return gameobject.Insert(new GameObjectSpawnModelEssentials()
{
Guid = int.MaxValue - 1
});
yield return creature.Delete(new CreatureSpawnModelEssentials()
{
Guid = int.MaxValue - 1
});
yield return gameobject.Delete(new GameObjectSpawnModelEssentials()
{
Guid = int.MaxValue - 1
});
yield return spawnGroupTemplate.Insert(new AbstractSpawnGroupTemplate()
{
Id = int.MaxValue - 1
});
yield return spawnGroupSpawn.Insert(new AbstractSpawnGroupSpawn()
{
TemplateId = int.MaxValue - 1,
Guid = int.MaxValue - 1
});
yield return spawnGroupTemplate.Delete(new AbstractSpawnGroupTemplate()
{
Id = int.MaxValue - 1
});
yield return spawnGroupSpawn.Delete(new AbstractSpawnGroupSpawn()
{
TemplateId = int.MaxValue - 1,
Guid = int.MaxValue - 1
});
yield return questChain.Update(new QuestChainDiff()
{
Id = int.MaxValue - 1,
BreadcrumbQuestId = 1,
ExclusiveGroup = -2,
NextQuestId = 3,
PrevQuestId = -1
});
yield return creatureDiff.Update(new CreatureDiff()
{
Guid = int.MaxValue - 1,
Position = Vector3.Zero,
Orientation = 0
});
yield return gameobjectDiff.Update(new GameObjectDiff()
{
Guid = int.MaxValue - 1,
Position = Vector3.Zero,
Orientation = 0,
Rotation = Quaternion.Identity
});
}
}