Commit bd0887c8 authored by mercury233's avatar mercury233

refactor enums

parent 464e5d9d
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using YGOSharp.OCGWrapper.Enums;
public class Book : WindowServant2D public class Book : WindowServant2D
{ {
...@@ -102,15 +103,15 @@ public class Book : WindowServant2D ...@@ -102,15 +103,15 @@ public class Book : WindowServant2D
} }
foreach (var item in Program.I().ocgcore.cards) foreach (var item in Program.I().ocgcore.cards)
{ {
if (item.p.location == (UInt32)game_location.search) if (item.p.location == (UInt32)CardLocation.Search)
{ {
continue; continue;
} }
if (item.p.location == (UInt32)game_location.LOCATION_UNKNOWN) if (item.p.location == (UInt32)CardLocation.Unknown)
{ {
continue; continue;
} }
if (item.p.location == (UInt32)game_location.LOCATION_DECK) if (item.p.location == (UInt32)CardLocation.Deck)
{ {
continue; continue;
} }
...@@ -132,7 +133,7 @@ public class Book : WindowServant2D ...@@ -132,7 +133,7 @@ public class Book : WindowServant2D
master = new MultiStringMaster(); master = new MultiStringMaster();
foreach (var item in Program.I().ocgcore.cards) foreach (var item in Program.I().ocgcore.cards)
{ {
if (item.p.location == (UInt32)game_location.search) if (item.p.location == (UInt32)CardLocation.Search)
{ {
continue; continue;
} }
...@@ -169,11 +170,11 @@ public class Book : WindowServant2D ...@@ -169,11 +170,11 @@ public class Book : WindowServant2D
bool died = false; bool died = false;
foreach (var item in Program.I().ocgcore.cards) foreach (var item in Program.I().ocgcore.cards)
{ {
if (item.p.location == (UInt32)game_location.search) if (item.p.location == (UInt32)CardLocation.Search)
{ {
continue; continue;
} }
if (item.p.location == (UInt32)game_location.LOCATION_UNKNOWN) if (item.p.location == (UInt32)CardLocation.Unknown)
{ {
continue; continue;
} }
...@@ -181,15 +182,15 @@ public class Book : WindowServant2D ...@@ -181,15 +182,15 @@ public class Book : WindowServant2D
{ {
if (item.p.controller == i) if (item.p.controller == i)
{ {
if (item.p.location == (UInt32)game_location.LOCATION_MZONE || item.p.location == (UInt32)game_location.LOCATION_SZONE) if (item.p.location == (UInt32)CardLocation.MonsterZone || item.p.location == (UInt32)CardLocation.SpellZone)
{ {
fieldCards[i]++; fieldCards[i]++;
} }
if (item.p.location == (UInt32)game_location.LOCATION_HAND) if (item.p.location == (UInt32)CardLocation.Hand)
{ {
handCards[i]++; handCards[i]++;
} }
if (item.p.location == (UInt32)game_location.LOCATION_GRAVE || item.p.location == (UInt32)game_location.LOCATION_REMOVED) if (item.p.location == (UInt32)CardLocation.Grave || item.p.location == (UInt32)CardLocation.Removed)
{ {
resourceCards[i]++; resourceCards[i]++;
} }
......
using UnityEngine; using UnityEngine;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using YGOSharp.OCGWrapper.Enums;
public class CardDescription : Servant public class CardDescription : Servant
{ {
...@@ -251,30 +252,30 @@ public class CardDescription : Servant ...@@ -251,30 +252,30 @@ public class CardDescription : Servant
{ {
if (gps.controller == 0) if (gps.controller == 0)
{ {
if ((gps.location & (UInt32)game_location.LOCATION_GRAVE) > 0) if ((gps.location & (UInt32)CardLocation.Grave) > 0)
{ {
myGrave.Add(curCard); myGrave.Add(curCard);
} }
if ((gps.location & (UInt32)game_location.LOCATION_REMOVED) > 0) if ((gps.location & (UInt32)CardLocation.Removed) > 0)
{ {
myBanished.Add(curCard); myBanished.Add(curCard);
} }
if ((gps.location & (UInt32)game_location.LOCATION_EXTRA) > 0) if ((gps.location & (UInt32)CardLocation.Extra) > 0)
{ {
myExtra.Add(curCard); myExtra.Add(curCard);
} }
} }
else else
{ {
if ((gps.location & (UInt32)game_location.LOCATION_GRAVE) > 0) if ((gps.location & (UInt32)CardLocation.Grave) > 0)
{ {
opGrave.Add(curCard); opGrave.Add(curCard);
} }
if ((gps.location & (UInt32)game_location.LOCATION_REMOVED) > 0) if ((gps.location & (UInt32)CardLocation.Removed) > 0)
{ {
opBanished.Add(curCard); opBanished.Add(curCard);
} }
if ((gps.location & (UInt32)game_location.LOCATION_EXTRA) > 0) if ((gps.location & (UInt32)CardLocation.Extra) > 0)
{ {
opExtra.Add(curCard); opExtra.Add(curCard);
} }
......
...@@ -96,72 +96,72 @@ public static class TcpHelper ...@@ -96,72 +96,72 @@ public static class TcpHelper
{ {
MemoryStream memoryStream = new MemoryStream(datas[i]); MemoryStream memoryStream = new MemoryStream(datas[i]);
BinaryReader r = new BinaryReader(memoryStream); BinaryReader r = new BinaryReader(memoryStream);
var ms = (YGOSharp.Network.Enums.StocMessage)(r.ReadByte()); var ms = (StocMessage)(r.ReadByte());
switch (ms) switch (ms)
{ {
case YGOSharp.Network.Enums.StocMessage.GameMsg: case StocMessage.GameMsg:
((Room)Program.I().room).StocMessage_GameMsg(r); Program.I().room.StocMessage_GameMsg(r);
break; break;
case YGOSharp.Network.Enums.StocMessage.ErrorMsg: case StocMessage.ErrorMsg:
((Room)Program.I().room).StocMessage_ErrorMsg(r); Program.I().room.StocMessage_ErrorMsg(r);
break; break;
case YGOSharp.Network.Enums.StocMessage.SelectHand: case StocMessage.SelectHand:
((Room)Program.I().room).StocMessage_SelectHand(r); Program.I().room.StocMessage_SelectHand(r);
break; break;
case YGOSharp.Network.Enums.StocMessage.SelectTp: case StocMessage.SelectTp:
((Room)Program.I().room).StocMessage_SelectTp(r); Program.I().room.StocMessage_SelectTp(r);
break; break;
case YGOSharp.Network.Enums.StocMessage.HandResult: case StocMessage.HandResult:
((Room)Program.I().room).StocMessage_HandResult(r); Program.I().room.StocMessage_HandResult(r);
break; break;
case YGOSharp.Network.Enums.StocMessage.TpResult: case StocMessage.TpResult:
((Room)Program.I().room).StocMessage_TpResult(r); Program.I().room.StocMessage_TpResult(r);
break; break;
case YGOSharp.Network.Enums.StocMessage.ChangeSide: case StocMessage.ChangeSide:
((Room)Program.I().room).StocMessage_ChangeSide(r); Program.I().room.StocMessage_ChangeSide(r);
TcpHelper.SaveRecord(); TcpHelper.SaveRecord();
break; break;
case YGOSharp.Network.Enums.StocMessage.WaitingSide: case StocMessage.WaitingSide:
((Room)Program.I().room).StocMessage_WaitingSide(r); Program.I().room.StocMessage_WaitingSide(r);
TcpHelper.SaveRecord(); TcpHelper.SaveRecord();
break; break;
case YGOSharp.Network.Enums.StocMessage.CreateGame: case StocMessage.CreateGame:
((Room)Program.I().room).StocMessage_CreateGame(r); Program.I().room.StocMessage_CreateGame(r);
break; break;
case YGOSharp.Network.Enums.StocMessage.JoinGame: case StocMessage.JoinGame:
((Room)Program.I().room).StocMessage_JoinGame(r); Program.I().room.StocMessage_JoinGame(r);
break; break;
case YGOSharp.Network.Enums.StocMessage.TypeChange: case StocMessage.TypeChange:
((Room)Program.I().room).StocMessage_TypeChange(r); Program.I().room.StocMessage_TypeChange(r);
break; break;
case YGOSharp.Network.Enums.StocMessage.LeaveGame: case StocMessage.LeaveGame:
((Room)Program.I().room).StocMessage_LeaveGame(r); Program.I().room.StocMessage_LeaveGame(r);
break; break;
case YGOSharp.Network.Enums.StocMessage.DuelStart: case StocMessage.DuelStart:
((Room)Program.I().room).StocMessage_DuelStart(r); Program.I().room.StocMessage_DuelStart(r);
break; break;
case YGOSharp.Network.Enums.StocMessage.DuelEnd: case StocMessage.DuelEnd:
((Room)Program.I().room).StocMessage_DuelEnd(r); Program.I().room.StocMessage_DuelEnd(r);
TcpHelper.SaveRecord(); TcpHelper.SaveRecord();
break; break;
case YGOSharp.Network.Enums.StocMessage.Replay: case StocMessage.Replay:
((Room)Program.I().room).StocMessage_Replay(r); Program.I().room.StocMessage_Replay(r);
TcpHelper.SaveRecord(); TcpHelper.SaveRecord();
break; break;
case YGOSharp.Network.Enums.StocMessage.TimeLimit: case StocMessage.TimeLimit:
((Ocgcore)Program.I().ocgcore).StocMessage_TimeLimit(r); Program.I().ocgcore.StocMessage_TimeLimit(r);
break; break;
case YGOSharp.Network.Enums.StocMessage.Chat: case StocMessage.Chat:
((Room)Program.I().room).StocMessage_Chat(r); Program.I().room.StocMessage_Chat(r);
break; break;
case YGOSharp.Network.Enums.StocMessage.HsPlayerEnter: case StocMessage.HsPlayerEnter:
((Room)Program.I().room).StocMessage_HsPlayerEnter(r); Program.I().room.StocMessage_HsPlayerEnter(r);
break; break;
case YGOSharp.Network.Enums.StocMessage.HsPlayerChange: case StocMessage.HsPlayerChange:
((Room)Program.I().room).StocMessage_HsPlayerChange(r); Program.I().room.StocMessage_HsPlayerChange(r);
break; break;
case YGOSharp.Network.Enums.StocMessage.HsWatchChange: case StocMessage.HsWatchChange:
((Room)Program.I().room).StocMessage_HsWatchChange(r); Program.I().room.StocMessage_HsWatchChange(r);
break; break;
default: default:
break; break;
...@@ -258,21 +258,21 @@ public static class TcpHelper ...@@ -258,21 +258,21 @@ public static class TcpHelper
deck = deckFor; deck = deckFor;
Package message = new Package(); Package message = new Package();
message.Fuction = (int)CtosMessage.UpdateDeck; message.Fuction = (int)CtosMessage.UpdateDeck;
message.Data.writer.Write((int)deckFor.Main.Count + deckFor.Extra.Count); message.Data.writer.Write(deckFor.Main.Count + deckFor.Extra.Count);
message.Data.writer.Write((int)deckFor.Side.Count); message.Data.writer.Write(deckFor.Side.Count);
for (int i = 0; i < deckFor.Main.Count; i++) for (int i = 0; i < deckFor.Main.Count; i++)
{ {
message.Data.writer.Write((int)deckFor.Main[i]); message.Data.writer.Write(deckFor.Main[i]);
var c = YGOSharp.CardsManager.Get((int)deckFor.Main[i]); var c = YGOSharp.CardsManager.Get(deckFor.Main[i]);
deckStrings.Add(c.Name); deckStrings.Add(c.Name);
} }
for (int i = 0; i < deckFor.Extra.Count; i++) for (int i = 0; i < deckFor.Extra.Count; i++)
{ {
message.Data.writer.Write((int)deckFor.Extra[i]); message.Data.writer.Write(deckFor.Extra[i]);
} }
for (int i = 0; i < deckFor.Side.Count; i++) for (int i = 0; i < deckFor.Side.Count; i++)
{ {
message.Data.writer.Write((int)deckFor.Side[i]); message.Data.writer.Write(deckFor.Side[i]);
} }
Send(message); Send(message);
} }
...@@ -322,7 +322,7 @@ public static class TcpHelper ...@@ -322,7 +322,7 @@ public static class TcpHelper
message.Data.writer.Write((Int16)Config.ClientVersion); message.Data.writer.Write((Int16)Config.ClientVersion);
message.Data.writer.Write((byte)204); message.Data.writer.Write((byte)204);
message.Data.writer.Write((byte)204); message.Data.writer.Write((byte)204);
message.Data.writer.Write((Int32)0); message.Data.writer.Write(0);
message.Data.writer.WriteUnicode(psw, 20); message.Data.writer.WriteUnicode(psw, 20);
Send(message); Send(message);
} }
...@@ -456,12 +456,12 @@ public static class TcpHelper ...@@ -456,12 +456,12 @@ public static class TcpHelper
i++; i++;
try try
{ {
if (item.Fuction == (int)YGOSharp.OCGWrapper.Enums.GameMessage.Start) if (item.Fuction == (int)GameMessage.Start)
{ {
write = true; write = true;
startI = i; startI = i;
} }
if (item.Fuction == (int)YGOSharp.OCGWrapper.Enums.GameMessage.ReloadField) if (item.Fuction == (int)GameMessage.ReloadField)
{ {
write = true; write = true;
startI = i; startI = i;
...@@ -630,7 +630,7 @@ public static class BinaryExtensions ...@@ -630,7 +630,7 @@ public static class BinaryExtensions
a.controller = (UInt32)Program.I().ocgcore.localPlayer(reader.ReadByte()); a.controller = (UInt32)Program.I().ocgcore.localPlayer(reader.ReadByte());
a.location = reader.ReadByte(); a.location = reader.ReadByte();
a.sequence = reader.ReadByte(); a.sequence = reader.ReadByte();
a.position = (int)game_position.POS_FACEUP_ATTACK; a.position = (int)CardPosition.FaceUpAttack;
return a; return a;
} }
......
...@@ -4,6 +4,8 @@ using System.Collections.Generic; ...@@ -4,6 +4,8 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using UnityEngine; using UnityEngine;
using YGOSharp.OCGWrapper.Enums;
public static class UIHelper public static class UIHelper
{ {
[DllImport("user32.dll")] [DllImport("user32.dll")]
...@@ -980,31 +982,31 @@ public static class UIHelper ...@@ -980,31 +982,31 @@ public static class UIHelper
{ {
res += InterString.Get("对方"); res += InterString.Get("对方");
} }
if ((p1.location & (UInt32)game_location.LOCATION_DECK) > 0) if ((p1.location & (UInt32)CardLocation.Deck) > 0)
{ {
res += InterString.Get("卡组"); res += InterString.Get("卡组");
} }
if ((p1.location & (UInt32)game_location.LOCATION_EXTRA) > 0) if ((p1.location & (UInt32)CardLocation.Extra) > 0)
{ {
res += InterString.Get("额外"); res += InterString.Get("额外");
} }
if ((p1.location & (UInt32)game_location.LOCATION_GRAVE) > 0) if ((p1.location & (UInt32)CardLocation.Grave) > 0)
{ {
res += InterString.Get("墓地"); res += InterString.Get("墓地");
} }
if ((p1.location & (UInt32)game_location.LOCATION_HAND) > 0) if ((p1.location & (UInt32)CardLocation.Hand) > 0)
{ {
res += InterString.Get("手牌"); res += InterString.Get("手牌");
} }
if ((p1.location & (UInt32)game_location.LOCATION_MZONE) > 0) if ((p1.location & (UInt32)CardLocation.MonsterZone) > 0)
{ {
res += InterString.Get("前场"); res += InterString.Get("前场");
} }
if ((p1.location & (UInt32)game_location.LOCATION_REMOVED) > 0) if ((p1.location & (UInt32)CardLocation.Removed) > 0)
{ {
res += InterString.Get("除外"); res += InterString.Get("除外");
} }
if ((p1.location & (UInt32)game_location.LOCATION_SZONE) > 0) if ((p1.location & (UInt32)CardLocation.SpellZone) > 0)
{ {
res += InterString.Get("后场"); res += InterString.Get("后场");
} }
...@@ -1014,41 +1016,41 @@ public static class UIHelper ...@@ -1014,41 +1016,41 @@ public static class UIHelper
//internal static string getGPSstringPosition(GPS p1) //internal static string getGPSstringPosition(GPS p1)
//{ //{
// string res = ""; // string res = "";
// if ((p1.location & (UInt32)game_location.LOCATION_OVERLAY) > 0) // if ((p1.location & (UInt32)CardLocation.Overlay) > 0)
// { // {
// res += InterString.Get("(被叠放)"); // res += InterString.Get("(被叠放)");
// } // }
// else // else
// { // {
// if ((p1.position & (UInt32)game_position.POS_FACEUP_ATTACK) > 0) // if ((p1.position & (UInt32)CardPosition.FaceUpAttack) > 0)
// { // {
// res += InterString.Get("(表侧攻击)"); // res += InterString.Get("(表侧攻击)");
// } // }
// else if ((p1.position & (UInt32)game_position.POS_FACEUP_DEFENSE) > 0) // else if ((p1.position & (UInt32)CardPosition.FaceUp_DEFENSE) > 0)
// { // {
// res += InterString.Get("(表侧防御)"); // res += InterString.Get("(表侧防御)");
// } // }
// else if ((p1.position & (UInt32)game_position.POS_FACEDOWN_ATTACK) > 0) // else if ((p1.position & (UInt32)CardPosition.FaceDownAttack) > 0)
// { // {
// res += InterString.Get("(里侧攻击)"); // res += InterString.Get("(里侧攻击)");
// } // }
// else if ((p1.position & (UInt32)game_position.POS_FACEDOWN_DEFENSE) > 0) // else if ((p1.position & (UInt32)CardPosition.FaceDown_DEFENSE) > 0)
// { // {
// res += InterString.Get("(里侧防御)"); // res += InterString.Get("(里侧防御)");
// } // }
// else if ((p1.position & (UInt32)game_position.POS_ATTACK) > 0) // else if ((p1.position & (UInt32)CardPosition.Attack) > 0)
// { // {
// res += InterString.Get("(攻击)"); // res += InterString.Get("(攻击)");
// } // }
// else if ((p1.position & (UInt32)game_position.POS_DEFENSE) > 0) // else if ((p1.position & (UInt32)CardPosition.POS_DEFENSE) > 0)
// { // {
// res += InterString.Get("(防御)"); // res += InterString.Get("(防御)");
// } // }
// else if ((p1.position & (UInt32)game_position.POS_FACEUP) > 0) // else if ((p1.position & (UInt32)CardPosition.FaceUp) > 0)
// { // {
// res += InterString.Get("(表侧)"); // res += InterString.Get("(表侧)");
// } // }
// else if ((p1.position & (UInt32)game_position.POS_DEFENSE) > 0) // else if ((p1.position & (UInt32)CardPosition.POS_DEFENSE) > 0)
// { // {
// res += InterString.Get("(里侧)"); // res += InterString.Get("(里侧)");
// } // }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using UnityEngine; using UnityEngine;
using YGOSharp.OCGWrapper.Enums;
public class GameField : OCGobject public class GameField : OCGobject
{ {
...@@ -90,14 +91,14 @@ public class GameField : OCGobject ...@@ -90,14 +91,14 @@ public class GameField : OCGobject
Program.I().ocgcore.AddUpdateAction_s(Update); Program.I().ocgcore.AddUpdateAction_s(Update);
gameHiddenButtons.Add(new gameHiddenButton(game_location.LOCATION_DECK, 0)); gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Deck, 0));
gameHiddenButtons.Add(new gameHiddenButton(game_location.LOCATION_EXTRA, 0)); gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Extra, 0));
gameHiddenButtons.Add(new gameHiddenButton(game_location.LOCATION_GRAVE, 0)); gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Grave, 0));
gameHiddenButtons.Add(new gameHiddenButton(game_location.LOCATION_REMOVED, 0)); gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Removed, 0));
gameHiddenButtons.Add(new gameHiddenButton(game_location.LOCATION_DECK, 1)); gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Deck, 1));
gameHiddenButtons.Add(new gameHiddenButton(game_location.LOCATION_EXTRA, 1)); gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Extra, 1));
gameHiddenButtons.Add(new gameHiddenButton(game_location.LOCATION_GRAVE, 1)); gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Grave, 1));
gameHiddenButtons.Add(new gameHiddenButton(game_location.LOCATION_REMOVED, 1)); gameHiddenButtons.Add(new gameHiddenButton(CardLocation.Removed, 1));
LOCATION_DECK_0 = create(Program.I().new_ui_textMesh, Vector3.zero, new Vector3(60, 0, 0)).GetComponent<TMPro.TextMeshPro>(); LOCATION_DECK_0 = create(Program.I().new_ui_textMesh, Vector3.zero, new Vector3(60, 0, 0)).GetComponent<TMPro.TextMeshPro>();
LOCATION_EXTRA_0 = create(Program.I().new_ui_textMesh, Vector3.zero, new Vector3(60, 0, 0)).GetComponent<TMPro.TextMeshPro>(); LOCATION_EXTRA_0 = create(Program.I().new_ui_textMesh, Vector3.zero, new Vector3(60, 0, 0)).GetComponent<TMPro.TextMeshPro>();
...@@ -260,15 +261,15 @@ public class GameField : OCGobject ...@@ -260,15 +261,15 @@ public class GameField : OCGobject
rightT.transform.localScale = new Vector3(1f / Program.fieldSize, 1f / Program.fieldSize, 1f / Program.fieldSize); rightT.transform.localScale = new Vector3(1f / Program.fieldSize, 1f / Program.fieldSize, 1f / Program.fieldSize);
rightT.transform.localPosition = new Vector3(((1f - 1f / Program.fieldSize) * (float)(rightT.width)) / 3.5f, 0, 0); rightT.transform.localPosition = new Vector3(((1f - 1f / Program.fieldSize) * (float)(rightT.width)) / 3.5f, 0, 0);
relocateTextMesh(LOCATION_DECK_0, 0, game_location.LOCATION_DECK, new Vector3(0, 0, -3f)); relocateTextMesh(LOCATION_DECK_0, 0, CardLocation.Deck, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_EXTRA_0, 0, game_location.LOCATION_EXTRA, new Vector3(0, 0, -3f)); relocateTextMesh(LOCATION_EXTRA_0, 0, CardLocation.Extra, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_REMOVED_0, 0, game_location.LOCATION_REMOVED, new Vector3(0, 0, -3f)); relocateTextMesh(LOCATION_REMOVED_0, 0, CardLocation.Removed, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_GRAVE_0, 0, game_location.LOCATION_GRAVE, new Vector3(0, 0, -3f)); relocateTextMesh(LOCATION_GRAVE_0, 0, CardLocation.Grave, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_DECK_1, 1, game_location.LOCATION_DECK, new Vector3(0, 0, -3f)); relocateTextMesh(LOCATION_DECK_1, 1, CardLocation.Deck, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_EXTRA_1, 1, game_location.LOCATION_EXTRA, new Vector3(0, 0, -3f)); relocateTextMesh(LOCATION_EXTRA_1, 1, CardLocation.Extra, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_REMOVED_1, 1, game_location.LOCATION_REMOVED, new Vector3(0, 0, -3f)); relocateTextMesh(LOCATION_REMOVED_1, 1, CardLocation.Removed, new Vector3(0, 0, -3f));
relocateTextMesh(LOCATION_GRAVE_1, 1, game_location.LOCATION_GRAVE, new Vector3(0, 0, -3f)); relocateTextMesh(LOCATION_GRAVE_1, 1, CardLocation.Grave, new Vector3(0, 0, -3f));
label.transform.localPosition = new Vector3(-5f * (Program.fieldSize - 1), 0, -15.5f * Program.fieldSize); label.transform.localPosition = new Vector3(-5f * (Program.fieldSize - 1), 0, -15.5f * Program.fieldSize);
...@@ -277,7 +278,7 @@ public class GameField : OCGobject ...@@ -277,7 +278,7 @@ public class GameField : OCGobject
prelong = isLong; prelong = isLong;
for (int i = 0; i < field_disabled_containers.Count; i++) for (int i = 0; i < field_disabled_containers.Count; i++)
{ {
if (field_disabled_containers[i].p.location == (UInt32)game_location.LOCATION_SZONE) if (field_disabled_containers[i].p.location == (UInt32)CardLocation.SpellZone)
{ {
if (field_disabled_containers[i].p.controller == 1) if (field_disabled_containers[i].p.controller == 1)
{ {
...@@ -400,7 +401,7 @@ public class GameField : OCGobject ...@@ -400,7 +401,7 @@ public class GameField : OCGobject
} }
private static void relocateTextMesh(TMPro.TextMeshPro obj, uint con, game_location loc,Vector3 poi) private static void relocateTextMesh(TMPro.TextMeshPro obj, uint con, CardLocation loc,Vector3 poi)
{ {
obj.transform.position = UIHelper.getCamGoodPosition(Program.I().ocgcore.get_point_worldposition(new GPS obj.transform.position = UIHelper.getCamGoodPosition(Program.I().ocgcore.get_point_worldposition(new GPS
{ {
...@@ -594,7 +595,7 @@ public class GameField : OCGobject ...@@ -594,7 +595,7 @@ public class GameField : OCGobject
if (Program.I().ocgcore.MasterRule >= 4) if (Program.I().ocgcore.MasterRule >= 4)
{ {
if (gps.location == (int)game_location.LOCATION_SZONE) if (gps.location == (int)CardLocation.SpellZone)
{ {
if (gps.position == 0 || gps.position == 4) if (gps.position == 0 || gps.position == 4)
{ {
......
using System; using System;
using UnityEngine; using UnityEngine;
using YGOSharp.OCGWrapper.Enums;
public class gameHiddenButton : OCGobject public class gameHiddenButton : OCGobject
{ {
public game_location location; public CardLocation location;
public int player; public int player;
...@@ -11,7 +12,7 @@ public class gameHiddenButton : OCGobject ...@@ -11,7 +12,7 @@ public class gameHiddenButton : OCGobject
GPS ps; GPS ps;
public gameHiddenButton(game_location l, int p) public gameHiddenButton(CardLocation l, int p)
{ {
ps = new GPS(); ps = new GPS();
ps.controller = (UInt32)p; ps.controller = (UInt32)p;
...@@ -107,7 +108,7 @@ public class gameHiddenButton : OCGobject ...@@ -107,7 +108,7 @@ public class gameHiddenButton : OCGobject
{ {
if (player == 0) if (player == 0)
{ {
if (location == game_location.LOCATION_DECK) if (location == CardLocation.Deck)
{ {
if (Program.I().book.lab != null) if (Program.I().book.lab != null)
{ {
...@@ -120,7 +121,7 @@ public class gameHiddenButton : OCGobject ...@@ -120,7 +121,7 @@ public class gameHiddenButton : OCGobject
} }
if (player == 1) if (player == 1)
{ {
if (location == game_location.LOCATION_DECK) if (location == CardLocation.Deck)
{ {
if (Program.I().book.labop != null) if (Program.I().book.labop != null)
{ {
...@@ -173,7 +174,7 @@ public class gameHiddenButton : OCGobject ...@@ -173,7 +174,7 @@ public class gameHiddenButton : OCGobject
{ {
if (player == 0) if (player == 0)
{ {
if (location == game_location.LOCATION_DECK) if (location == CardLocation.Deck)
{ {
if (Program.I().book.lab != null) if (Program.I().book.lab != null)
{ {
...@@ -201,7 +202,7 @@ public class gameHiddenButton : OCGobject ...@@ -201,7 +202,7 @@ public class gameHiddenButton : OCGobject
if (player == 1) if (player == 1)
{ {
if (location == game_location.LOCATION_DECK) if (location == CardLocation.Deck)
{ {
if (Program.I().book.labop != null) if (Program.I().book.labop != null)
{ {
......
This diff is collapsed.
using System; using System;
using YGOSharp; using YGOSharp;
using YGOSharp.OCGWrapper.Enums;
public class GameStringHelper public class GameStringHelper
{ {
public static string fen = "/"; public static string fen = "/";
...@@ -149,27 +150,27 @@ public class GameStringHelper ...@@ -149,27 +150,27 @@ public class GameStringHelper
{ {
} }
if (differ(card.Attribute,(int)game_attributes.ATTRIBUTE_EARTH)) if (differ(card.Attribute, (int)CardAttribute.Earth))
{ {
re = "[F4A460]" + re + "[-]"; re = "[F4A460]" + re + "[-]";
} }
if (differ(card.Attribute, (int)game_attributes.ATTRIBUTE_WATER)) if (differ(card.Attribute, (int)CardAttribute.Water))
{ {
re = "[D1EEEE]" + re + "[-]"; re = "[D1EEEE]" + re + "[-]";
} }
if (differ(card.Attribute, (int)game_attributes.ATTRIBUTE_FIRE)) if (differ(card.Attribute, (int)CardAttribute.Fire))
{ {
re = "[F08080]" + re + "[-]"; re = "[F08080]" + re + "[-]";
} }
if (differ(card.Attribute, (int)game_attributes.ATTRIBUTE_WIND)) if (differ(card.Attribute, (int)CardAttribute.Wind))
{ {
re = "[B3EE3A]" + re + "[-]"; re = "[B3EE3A]" + re + "[-]";
} }
if (differ(card.Attribute, (int)game_attributes.ATTRIBUTE_LIGHT)) if (differ(card.Attribute, (int)CardAttribute.Light))
{ {
re = "[EEEE00]" + re + "[-]"; re = "[EEEE00]" + re + "[-]";
} }
if (differ(card.Attribute, (int)game_attributes.ATTRIBUTE_DARK)) if (differ(card.Attribute, (int)CardAttribute.Dark))
{ {
re = "[FF00FF]" + re + "[-]"; re = "[FF00FF]" + re + "[-]";
} }
...@@ -182,9 +183,9 @@ public class GameStringHelper ...@@ -182,9 +183,9 @@ public class GameStringHelper
string re = ""; string re = "";
try try
{ {
if (differ(card.Type, (long)game_type.TYPE_MONSTER)) re += "[ff8000]" + mainType(card.Type); if (differ(card.Type, (long)CardType.Monster)) re += "[ff8000]" + mainType(card.Type);
else if (differ(card.Type, (long)game_type.TYPE_SPELL)) re += "[7FFF00]" + mainType(card.Type); else if (differ(card.Type, (long)CardType.Spell)) re += "[7FFF00]" + mainType(card.Type);
else if (differ(card.Type, (long)game_type.TYPE_TRAP)) re += "[dda0dd]" + mainType(card.Type); else if (differ(card.Type, (long)CardType.Trap)) re += "[dda0dd]" + mainType(card.Type);
else re += "[ff8000]" + mainType(card.Type); else re += "[ff8000]" + mainType(card.Type);
re += "[-]"; re += "[-]";
} }
...@@ -206,9 +207,9 @@ public class GameStringHelper ...@@ -206,9 +207,9 @@ public class GameStringHelper
re += "[ff8000]"; re += "[ff8000]";
re += "["+secondType(data.Type)+"]"; re += "["+secondType(data.Type)+"]";
if ((data.Type & (int)game_type.link) == 0) if ((data.Type & (int)CardType.Link) == 0)
{ {
if ((data.Type & (int)game_type.TYPE_XYZ) > 0) if ((data.Type & (int)CardType.Xyz) > 0)
{ {
re += " " + race(data.Race) + fen + attribute(data.Attribute) + fen + data.Level.ToString() + "[sup]☆[/sup]"; re += " " + race(data.Race) + fen + attribute(data.Attribute) + fen + data.Level.ToString() + "[sup]☆[/sup]";
} }
...@@ -251,7 +252,7 @@ public class GameStringHelper ...@@ -251,7 +252,7 @@ public class GameStringHelper
re += "[sup]ATK[/sup]" + data.Attack.ToString() + " "; re += "[sup]ATK[/sup]" + data.Attack.ToString() + " ";
} }
} }
if ((data.Type & (int)game_type.link) == 0) if ((data.Type & (int)CardType.Link) == 0)
{ {
if (data.Defense < 0) if (data.Defense < 0)
{ {
......
...@@ -5,7 +5,8 @@ using System.Collections.Generic; ...@@ -5,7 +5,8 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Threading; using System.Threading;
using UnityEngine; using UnityEngine;
using YGOSharp.OCGWrapper.Enums;
public enum GameTextureType public enum GameTextureType
{ {
card_picture = 0, card_picture = 0,
...@@ -217,7 +218,7 @@ public class GameTextureManager ...@@ -217,7 +218,7 @@ public class GameTextureManager
pic = waitLoadStack.Pop(); pic = waitLoadStack.Pop();
try try
{ {
pic.pCard = (YGOSharp.CardsManager.Get((int)pic.code).Type & (int)game_type.TYPE_PENDULUM) > 0; pic.pCard = (YGOSharp.CardsManager.Get((int)pic.code).Type & (int)CardType.Pendulum) > 0;
} }
catch (Exception e) catch (Exception e)
{ {
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using YGOSharp.Network.Enums;
public class Room : WindowServantSP public class Room : WindowServantSP
{ {
UIselectableList superScrollView = null; UIselectableList superScrollView = null;
...@@ -254,30 +255,30 @@ public class Room : WindowServantSP ...@@ -254,30 +255,30 @@ public class Room : WindowServantSP
p.Data = new BinaryMaster(); p.Data = new BinaryMaster();
p.Data.writer.WriteUnicode(res, res.Length + 1); p.Data.writer.WriteUnicode(res, res.Length + 1);
TcpHelper.AddRecordLine(p); TcpHelper.AddRecordLine(p);
switch ((YGOSharp.Network.Enums.PlayerType)player) switch ((PlayerType)player)
{ {
case YGOSharp.Network.Enums.PlayerType.Red: case PlayerType.Red:
result = "[FF3030]" + result + "[-]"; result = "[FF3030]" + result + "[-]";
break; break;
case YGOSharp.Network.Enums.PlayerType.Green: case PlayerType.Green:
result = "[7CFC00]" + result + "[-]"; result = "[7CFC00]" + result + "[-]";
break; break;
case YGOSharp.Network.Enums.PlayerType.Blue: case PlayerType.Blue:
result = "[4876FF]" + result + "[-]"; result = "[4876FF]" + result + "[-]";
break; break;
case YGOSharp.Network.Enums.PlayerType.BabyBlue: case PlayerType.BabyBlue:
result = "[63B8FF]" + result + "[-]"; result = "[63B8FF]" + result + "[-]";
break; break;
case YGOSharp.Network.Enums.PlayerType.Pink: case PlayerType.Pink:
result = "[EED2EE]" + result + "[-]"; result = "[EED2EE]" + result + "[-]";
break; break;
case YGOSharp.Network.Enums.PlayerType.Yellow: case PlayerType.Yellow:
result = "[EEEE00]" + result + "[-]"; result = "[EEEE00]" + result + "[-]";
break; break;
case YGOSharp.Network.Enums.PlayerType.White: case PlayerType.White:
result = "[FAF0E6]" + result + "[-]"; result = "[FAF0E6]" + result + "[-]";
break; break;
case YGOSharp.Network.Enums.PlayerType.Gray: case PlayerType.Gray:
result = "[CDC9C9]" + result + "[-]"; result = "[CDC9C9]" + result + "[-]";
break; break;
} }
......
...@@ -3,6 +3,8 @@ using System.Collections.Generic; ...@@ -3,6 +3,8 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using UnityEngine; using UnityEngine;
using YGOSharp.OCGWrapper.Enums;
public class selectDeck : WindowServantSP public class selectDeck : WindowServantSP
{ {
...@@ -308,15 +310,15 @@ public class selectDeck : WindowServantSP ...@@ -308,15 +310,15 @@ public class selectDeck : WindowServantSP
{ {
mainAll++; mainAll++;
YGOSharp.Card c = YGOSharp.CardsManager.Get(item); YGOSharp.Card c = YGOSharp.CardsManager.Get(item);
if ((c.Type & (UInt32)game_type.TYPE_MONSTER) > 0) if ((c.Type & (UInt32)CardType.Monster) > 0)
{ {
mainMonster++; mainMonster++;
} }
if ((c.Type & (UInt32)game_type.TYPE_SPELL) > 0) if ((c.Type & (UInt32)CardType.Spell) > 0)
{ {
mainSpell++; mainSpell++;
} }
if ((c.Type & (UInt32)game_type.TYPE_TRAP) > 0) if ((c.Type & (UInt32)CardType.Trap) > 0)
{ {
mainTrap++; mainTrap++;
} }
...@@ -339,15 +341,15 @@ public class selectDeck : WindowServantSP ...@@ -339,15 +341,15 @@ public class selectDeck : WindowServantSP
{ {
sideAll++; sideAll++;
YGOSharp.Card c = YGOSharp.CardsManager.Get(item); YGOSharp.Card c = YGOSharp.CardsManager.Get(item);
if ((c.Type & (UInt32)game_type.TYPE_MONSTER) > 0) if ((c.Type & (UInt32)CardType.Monster) > 0)
{ {
sideMonster++; sideMonster++;
} }
if ((c.Type & (UInt32)game_type.TYPE_SPELL) > 0) if ((c.Type & (UInt32)CardType.Spell) > 0)
{ {
sideSpell++; sideSpell++;
} }
if ((c.Type & (UInt32)game_type.TYPE_TRAP) > 0) if ((c.Type & (UInt32)CardType.Trap) > 0)
{ {
sideTrap++; sideTrap++;
} }
...@@ -369,19 +371,19 @@ public class selectDeck : WindowServantSP ...@@ -369,19 +371,19 @@ public class selectDeck : WindowServantSP
{ {
extraAll++; extraAll++;
YGOSharp.Card c = YGOSharp.CardsManager.Get(item); YGOSharp.Card c = YGOSharp.CardsManager.Get(item);
if ((c.Type & (UInt32)game_type.TYPE_FUSION) > 0) if ((c.Type & (UInt32)CardType.Fusion) > 0)
{ {
extraFusion++; extraFusion++;
} }
if ((c.Type & (UInt32)game_type.TYPE_SYNCHRO) > 0) if ((c.Type & (UInt32)CardType.Synchro) > 0)
{ {
extraSync++; extraSync++;
} }
if ((c.Type & (UInt32)game_type.TYPE_XYZ) > 0) if ((c.Type & (UInt32)CardType.Xyz) > 0)
{ {
extraXyz++; extraXyz++;
} }
if ((c.Type & (UInt32)game_type.link) > 0) if ((c.Type & (UInt32)CardType.Link) > 0)
{ {
extraLink++; extraLink++;
} }
......
...@@ -1279,7 +1279,7 @@ public class DeckManager : ServantWithCardDescription ...@@ -1279,7 +1279,7 @@ public class DeckManager : ServantWithCardDescription
{ {
if (deck.GetCardCount(cardPicLoader_.data.Id) < currentBanlist.GetQuantity(cardPicLoader_.data.Id)) if (deck.GetCardCount(cardPicLoader_.data.Id) < currentBanlist.GetQuantity(cardPicLoader_.data.Id))
{ {
if ((cardPicLoader_.data.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Token) == 0) if ((cardPicLoader_.data.Type & (UInt32)CardType.Token) == 0)
{ {
MonoCardInDeckManager card = createCard(); MonoCardInDeckManager card = createCard();
card.transform.position = card.getGoodPosition(4); card.transform.position = card.getGoodPosition(4);
...@@ -1348,13 +1348,13 @@ public class DeckManager : ServantWithCardDescription ...@@ -1348,13 +1348,13 @@ public class DeckManager : ServantWithCardDescription
if (isSide) if (isSide)
{ {
if ( if (
(MonoCardInDeckManager_.cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Fusion) > 0 (MonoCardInDeckManager_.cardData.Type & (UInt32)CardType.Fusion) > 0
|| ||
(MonoCardInDeckManager_.cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Synchro) > 0 (MonoCardInDeckManager_.cardData.Type & (UInt32)CardType.Synchro) > 0
|| ||
(MonoCardInDeckManager_.cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Xyz) > 0 (MonoCardInDeckManager_.cardData.Type & (UInt32)CardType.Xyz) > 0
|| ||
(MonoCardInDeckManager_.cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Link) > 0 (MonoCardInDeckManager_.cardData.Type & (UInt32)CardType.Link) > 0
) )
{ {
deck.IExtra.Add(MonoCardInDeckManager_); deck.IExtra.Add(MonoCardInDeckManager_);
...@@ -1387,13 +1387,13 @@ public class DeckManager : ServantWithCardDescription ...@@ -1387,13 +1387,13 @@ public class DeckManager : ServantWithCardDescription
card.cardData = data; card.cardData = data;
card.gameObject.layer = 16; card.gameObject.layer = 16;
if ( if (
(data.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Fusion) > 0 (data.Type & (UInt32)CardType.Fusion) > 0
|| ||
(data.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Synchro) > 0 (data.Type & (UInt32)CardType.Synchro) > 0
|| ||
(data.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Xyz) > 0 (data.Type & (UInt32)CardType.Xyz) > 0
|| ||
(data.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Link) > 0 (data.Type & (UInt32)CardType.Link) > 0
) )
{ {
deck.IExtra.Add(card); deck.IExtra.Add(card);
...@@ -1572,13 +1572,13 @@ public class DeckManager : ServantWithCardDescription ...@@ -1572,13 +1572,13 @@ public class DeckManager : ServantWithCardDescription
if (p.z > -8) if (p.z > -8)
{ {
if ( if (
(deckTemp[i].cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Fusion) > 0 (deckTemp[i].cardData.Type & (UInt32)CardType.Fusion) > 0
|| ||
(deckTemp[i].cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Synchro) > 0 (deckTemp[i].cardData.Type & (UInt32)CardType.Synchro) > 0
|| ||
(deckTemp[i].cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Xyz) > 0 (deckTemp[i].cardData.Type & (UInt32)CardType.Xyz) > 0
|| ||
(deckTemp[i].cardData.Type & (UInt32)YGOSharp.OCGWrapper.Enums.CardType.Link) > 0 (deckTemp[i].cardData.Type & (UInt32)CardType.Link) > 0
) )
{ {
deck.IExtra.Add(deckTemp[i]); deck.IExtra.Add(deckTemp[i]);
......
...@@ -4,7 +4,8 @@ using Mono.Data.Sqlite; ...@@ -4,7 +4,8 @@ using Mono.Data.Sqlite;
using System; using System;
using System.IO; using System.IO;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using YGOSharp.OCGWrapper.Enums;
namespace YGOSharp namespace YGOSharp
{ {
internal static class CardsManager internal static class CardsManager
...@@ -113,7 +114,7 @@ namespace YGOSharp ...@@ -113,7 +114,7 @@ namespace YGOSharp
foreach (var item in _cards) foreach (var item in _cards)
{ {
Card card = item.Value; Card card = item.Value;
if ((card.Type & (uint)game_type.TYPE_TOKEN) == 0) if ((card.Type & (uint)CardType.Token) == 0)
{ {
if (getName == "" if (getName == ""
|| Regex.Replace(card.Name, getName,"miaowu", RegexOptions.IgnoreCase) != card.Name || Regex.Replace(card.Name, getName,"miaowu", RegexOptions.IgnoreCase) != card.Name
...@@ -224,7 +225,7 @@ namespace YGOSharp ...@@ -224,7 +225,7 @@ namespace YGOSharp
{ {
switch (getsearchCode[i]) switch (getsearchCode[i])
{ {
case (int)OCGWrapper.Enums.searchCode.OPCODE_ADD: case (int)searchCode.OPCODE_ADD:
if (stack.Count >= 2) if (stack.Count >= 2)
{ {
int rhs = stack.Pop(); int rhs = stack.Pop();
...@@ -232,7 +233,7 @@ namespace YGOSharp ...@@ -232,7 +233,7 @@ namespace YGOSharp
stack.Push(lhs + rhs); stack.Push(lhs + rhs);
} }
break; break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_SUB: case (int)searchCode.OPCODE_SUB:
if (stack.Count >= 2) if (stack.Count >= 2)
{ {
int rhs = stack.Pop(); int rhs = stack.Pop();
...@@ -240,7 +241,7 @@ namespace YGOSharp ...@@ -240,7 +241,7 @@ namespace YGOSharp
stack.Push(lhs - rhs); stack.Push(lhs - rhs);
} }
break; break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_MUL: case (int)searchCode.OPCODE_MUL:
if (stack.Count >= 2) if (stack.Count >= 2)
{ {
int rhs = stack.Pop(); int rhs = stack.Pop();
...@@ -248,7 +249,7 @@ namespace YGOSharp ...@@ -248,7 +249,7 @@ namespace YGOSharp
stack.Push(lhs * rhs); stack.Push(lhs * rhs);
} }
break; break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_DIV: case (int)searchCode.OPCODE_DIV:
if (stack.Count >= 2) if (stack.Count >= 2)
{ {
int rhs = stack.Pop(); int rhs = stack.Pop();
...@@ -256,7 +257,7 @@ namespace YGOSharp ...@@ -256,7 +257,7 @@ namespace YGOSharp
stack.Push(lhs / rhs); stack.Push(lhs / rhs);
} }
break; break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_AND: case (int)searchCode.OPCODE_AND:
if (stack.Count >= 2) if (stack.Count >= 2)
{ {
int rhs = stack.Pop(); int rhs = stack.Pop();
...@@ -273,7 +274,7 @@ namespace YGOSharp ...@@ -273,7 +274,7 @@ namespace YGOSharp
} }
} }
break; break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_OR: case (int)searchCode.OPCODE_OR:
if (stack.Count >= 2) if (stack.Count >= 2)
{ {
int rhs = stack.Pop(); int rhs = stack.Pop();
...@@ -290,14 +291,14 @@ namespace YGOSharp ...@@ -290,14 +291,14 @@ namespace YGOSharp
} }
} }
break; break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_NEG: case (int)searchCode.OPCODE_NEG:
if (stack.Count >= 1) if (stack.Count >= 1)
{ {
int rhs = stack.Pop(); int rhs = stack.Pop();
stack.Push(-rhs); stack.Push(-rhs);
} }
break; break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_NOT: case (int)searchCode.OPCODE_NOT:
if (stack.Count >= 1) if (stack.Count >= 1)
{ {
int rhs = stack.Pop(); int rhs = stack.Pop();
...@@ -312,7 +313,7 @@ namespace YGOSharp ...@@ -312,7 +313,7 @@ namespace YGOSharp
} }
} }
break; break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_ISCODE: case (int)searchCode.OPCODE_ISCODE:
if (stack.Count >= 1) if (stack.Count >= 1)
{ {
int code = stack.Pop(); int code = stack.Pop();
...@@ -327,7 +328,7 @@ namespace YGOSharp ...@@ -327,7 +328,7 @@ namespace YGOSharp
} }
} }
break; break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_ISSETCARD: case (int)searchCode.OPCODE_ISSETCARD:
if (stack.Count >= 1) if (stack.Count >= 1)
{ {
if (IfSetCard(stack.Pop(), card.Setcode)) if (IfSetCard(stack.Pop(), card.Setcode))
...@@ -340,7 +341,7 @@ namespace YGOSharp ...@@ -340,7 +341,7 @@ namespace YGOSharp
} }
} }
break; break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_ISTYPE: case (int)searchCode.OPCODE_ISTYPE:
if (stack.Count >= 1) if (stack.Count >= 1)
{ {
if ((stack.Pop() & card.Type) > 0) if ((stack.Pop() & card.Type) > 0)
...@@ -353,7 +354,7 @@ namespace YGOSharp ...@@ -353,7 +354,7 @@ namespace YGOSharp
} }
} }
break; break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_ISRACE: case (int)searchCode.OPCODE_ISRACE:
if (stack.Count >= 1) if (stack.Count >= 1)
{ {
if ((stack.Pop() & card.Race) > 0) if ((stack.Pop() & card.Race) > 0)
...@@ -366,7 +367,7 @@ namespace YGOSharp ...@@ -366,7 +367,7 @@ namespace YGOSharp
} }
} }
break; break;
case (int)OCGWrapper.Enums.searchCode.OPCODE_ISATTRIBUTE: case (int)searchCode.OPCODE_ISATTRIBUTE:
if (stack.Count >= 1) if (stack.Count >= 1)
{ {
if ((stack.Pop() & card.Attribute) > 0) if ((stack.Pop() & card.Attribute) > 0)
...@@ -387,13 +388,13 @@ namespace YGOSharp ...@@ -387,13 +388,13 @@ namespace YGOSharp
if (stack.Count != 1 || stack.Pop() == 0) if (stack.Count != 1 || stack.Pop() == 0)
return false; return false;
return return
card.Id == (int)YGOSharp.OCGWrapper.Enums.Sp.CARD_MARINE_DOLPHIN card.Id == (int)TwoNameCards.CARD_MARINE_DOLPHIN
|| ||
card.Id == (int)YGOSharp.OCGWrapper.Enums.Sp.CARD_TWINKLE_MOSS card.Id == (int)TwoNameCards.CARD_TWINKLE_MOSS
|| ||
(!(card.Alias != 0) (!(card.Alias != 0)
&& ((card.Type & ((int)YGOSharp.OCGWrapper.Enums.CardType.Monster + (int)YGOSharp.OCGWrapper.Enums.CardType.Token))) && ((card.Type & ((int)CardType.Monster + (int)CardType.Token)))
!= ((int)YGOSharp.OCGWrapper.Enums.CardType.Monster + (int)YGOSharp.OCGWrapper.Enums.CardType.Token)); != ((int)CardType.Monster + (int)CardType.Token));
} }
public static bool IfSetCard(int setCodeToAnalyse, long setCodeFromCard) public static bool IfSetCard(int setCodeToAnalyse, long setCodeFromCard)
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
Divine = 0x40, Divine = 0x40,
} }
public enum Sp public enum TwoNameCards
{ {
CARD_MARINE_DOLPHIN = 78734254, CARD_MARINE_DOLPHIN = 78734254,
CARD_TWINKLE_MOSS = 13857930, CARD_TWINKLE_MOSS = 13857930,
......
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
Removed = 0x20, Removed = 0x20,
Extra = 0x40, Extra = 0x40,
Overlay = 0x80, Overlay = 0x80,
Onfield = 0x0C Onfield = 0x0C,
Unknown = 0,
Search = 0x800
} }
} }
\ No newline at end of file
fileFormatVersion: 2
guid: f327885de3e94cd4187a9a4e91544c1f
folderAsset: yes
timeCreated: 1469172510
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 94fe09e18fbcd1946af542ce761a3470
timeCreated: 1480605655
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
fileFormatVersion: 2
guid: 0c4a0e6dafcb7be4d9579cc54c1a3547
timeCreated: 1469113965
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
public enum game_function
{
MSG_RETRY = 1,
MSG_HINT = 2,
MSG_WAITING = 3,
MSG_START = 4,
MSG_WIN = 5,
MSG_UPDATE_DATA = 6,
MSG_UPDATE_CARD = 7,
MSG_REQUEST_DECK = 8,
MSG_SELECT_BATTLECMD = 10,
MSG_SELECT_IDLECMD = 11,
MSG_SELECT_EFFECTYN = 12,
MSG_SELECT_YESNO = 13,
MSG_SELECT_OPTION = 14,
MSG_SELECT_CARD = 15,
MSG_SELECT_CHAIN = 16,
MSG_SELECT_PLACE = 18,
MSG_SELECT_POSITION = 19,
MSG_SELECT_TRIBUTE = 20,
MSG_SORT_CHAIN = 21,
MSG_SELECT_COUNTER = 22,
MSG_SELECT_SUM = 23,
MSG_SELECT_DISFIELD = 24,
MSG_SORT_CARD = 25,
MSG_CONFIRM_DECKTOP = 30,
MSG_CONFIRM_CARDS = 31,
MSG_SHUFFLE_DECK = 32,
MSG_SHUFFLE_HAND = 33,
MSG_REFRESH_DECK = 34,
MSG_SWAP_GRAVE_DECK = 35,
MSG_SHUFFLE_SET_CARD = 36,
MSG_REVERSE_DECK = 37,
MSG_DECK_TOP = 38,
MSG_NEW_TURN = 40,
MSG_NEW_PHASE = 41,
MSG_MOVE = 50,
MSG_POS_CHANGE = 53,
MSG_SET = 54,
MSG_SWAP = 55,
MSG_FIELD_DISABLED = 56,
MSG_SUMMONING = 60,
MSG_SUMMONED = 61,
MSG_SPSUMMONING = 62,
MSG_SPSUMMONED = 63,
MSG_FLIPSUMMONING = 64,
MSG_FLIPSUMMONED = 65,
MSG_CHAINING = 70,
MSG_CHAINED = 71,
MSG_CHAIN_SOLVING = 72,
MSG_CHAIN_SOLVED = 73,
MSG_CHAIN_END = 74,
MSG_CHAIN_NEGATED = 75,
MSG_CHAIN_DISABLED = 76,
MSG_CARD_SELECTED = 80,
MSG_RANDOM_SELECTED = 81,
MSG_BECOME_TARGET = 83,
MSG_DRAW = 90,
MSG_DAMAGE = 91,
MSG_RECOVER = 92,
MSG_EQUIP = 93,
MSG_LPUPDATE = 94,
MSG_UNEQUIP = 95,
MSG_CARD_TARGET = 96,
MSG_CANCEL_TARGET = 97,
MSG_PAY_LPCOST = 100,
MSG_ADD_COUNTER = 101,
MSG_REMOVE_COUNTER = 102,
MSG_ATTACK = 110,
MSG_BATTLE = 111,
MSG_ATTACK_DISABLED = 112,
MSG_DAMAGE_STEP_START = 113,
MSG_DAMAGE_STEP_END = 114,
MSG_MISSED_EFFECT = 120,
MSG_BE_CHAIN_TARGET = 121,
MSG_CREATE_RELATION = 122,
MSG_RELEASE_RELATION = 123,
MSG_TOSS_COIN = 130,
MSG_TOSS_DICE = 131,
MSG_ANNOUNCE_RACE = 140,
MSG_ANNOUNCE_ATTRIB = 141,
MSG_ANNOUNCE_CARD = 142,
MSG_ANNOUNCE_NUMBER = 143,
MSG_CARD_HINT = 160,
MSG_TAG_SWAP = 161,
MSG_RELOAD_FIELD = 162,
MSG_AI_NAME = 163,
MSG_SHOW_HINT = 164,
MSG_MATCH_KILL = 170,
MSG_CUSTOM_MSG = 180,
MSG_HINT_EVENT = 190,
MSG_HINT_MESSAGE = 191,
MSG_HINT_SELECTMSG = 192,
MSG_HINT_OPSELECTED = 193,
MSG_HINT_EFFECT = 194,
MSG_HINT_RACE = 195,
MSG_HINT_ATTRIB = 196,
MSG_HINT_CODE = 197,
MSG_HINT_NUMBER = 198,
MSG_HINT_CARD = 199,
MSG_CHINT_TURN = 200,
MSG_CHINT_CARD = 201,
MSG_CHINT_RACE = 202,
MSG_CHINT_ATTRIBUTE = 203,
MSG_CHINT_NUMBER = 204,
MSG_CHINT_DESC_ADD = 205,
MSG_CHINT_DESC_REMOVE = 206,
MSG_QUERY_CODE = 210,
MSG_QUERY_POSITION = 211,
MSG_QUERY_ALIAS = 212,
MSG_QUERY_TYPE = 213,
MSG_QUERY_LEVEL = 214,
MSG_QUERY_RANK = 215,
MSG_QUERY_ATTRIBUTE = 216,
MSG_QUERY_RACE = 217,
MSG_QUERY_ATTACK = 218,
MSG_QUERY_DEFENSE = 219,
MSG_QUERY_BASE_ATTACK = 220,
MSG_QUERY_BASE_DEFENSE = 221,
MSG_QUERY_REASON = 222,
MSG_QUERY_REASON_CARD = 223,
MSG_QUERY_EQUIP_CARD = 224,
MSG_QUERY_TARGET_CARD = 225,
MSG_QUERY_OVERLAY_CARD = 226,
MSG_QUERY_COUNTERS = 227,
MSG_QUERY_OWNER = 228,
MSG_QUERY_IS_DISABLED = 229,
MSG_QUERY_IS_PUBLIC = 230,
MSG_QUERY_LSCALE = 231,
MSG_QUERY_RSCALE = 232,
}
public enum game_position
{
POS_FACEUP_ATTACK = 0x1,
POS_FACEDOWN_ATTACK = 0x2,
POS_FACEUP_DEFENSE = 0x4,
POS_FACEDOWN_DEFENSE = 0x8,
POS_FACEUP = 0x5,
POS_FACEDOWN = 0xa,
POS_ATTACK = 0x3,
POS_DEFENSE = 0xc,
}
public enum game_location
{
LOCATION_UNKNOWN=0x00,
LOCATION_DECK = 0x01,
LOCATION_HAND = 0x02,
LOCATION_MZONE = 0x04,
LOCATION_SZONE = 0x08,
LOCATION_GRAVE = 0x10,
LOCATION_REMOVED = 0x20,
LOCATION_EXTRA = 0x40,
LOCATION_OVERLAY = 0x80,
LOCATION_ONFIELD = 0x0c,
LOCATION_FZONE = 0x100,
LOCATION_PZONE = 0x200,
search = 0x800,
}
public enum game_race
{
RACE_WARRIOR = 0x1,
RACE_SPELLCASTER = 0x2,
RACE_FAIRY = 0x4,
RACE_FIEND = 0x8,
RACE_ZOMBIE = 0x10,
RACE_MACHINE = 0x20,
RACE_AQUA = 0x40,
RACE_PYRO = 0x80,
RACE_ROCK = 0x100,
RACE_WINDBEAST = 0x200,
RACE_PLANT = 0x400,
RACE_INSECT = 0x800,
RACE_THUNDER = 0x1000,
RACE_DRAGON = 0x2000,
RACE_BEAST = 0x4000,
RACE_BEASTWARRIOR = 0x8000,
RACE_DINOSAUR = 0x10000,
RACE_FISH = 0x20000,
RACE_SEASERPENT = 0x40000,
RACE_REPTILE = 0x80000,
RACE_PSYCHO = 0x100000,
RACE_DEVINE = 0x200000,
RACE_CREATORGOD = 0x400000,
RACE_PHANTOMDRAGON = 0x800000,
}
public enum game_attributes
{
ATTRIBUTE_EARTH = 0x01,
ATTRIBUTE_WATER = 0x02,
ATTRIBUTE_FIRE = 0x04,
ATTRIBUTE_WIND = 0x08,
ATTRIBUTE_LIGHT = 0x10,
ATTRIBUTE_DARK = 0x20,
ATTRIBUTE_DEVINE = 0x40,
}
public enum game_type
{
TYPE_MONSTER = 0x1,
TYPE_SPELL = 0x2,
TYPE_TRAP = 0x4,
TYPE_NORMAL = 0x10,
TYPE_EFFECT = 0x20,
TYPE_FUSION = 0x40,
TYPE_RITUAL = 0x80,
TYPE_TRAPMONSTER = 0x100,
TYPE_SPIRIT = 0x200,
TYPE_UNION = 0x400,
TYPE_DUAL = 0x800,
TYPE_TUNER = 0x1000,
TYPE_SYNCHRO = 0x2000,
TYPE_TOKEN = 0x4000,
TYPE_QUICKPLAY = 0x10000,
TYPE_CONTINUOUS = 0x20000,
TYPE_EQUIP = 0x40000,
TYPE_FIELD = 0x80000,
TYPE_COUNTER = 0x100000,
TYPE_FLIP = 0x200000,
TYPE_TOON = 0x400000,
TYPE_XYZ = 0x800000,
TYPE_PENDULUM = 0x1000000,
link = 0x4000000,
}
public enum servant_type
{
OCGCORE_DEBUG = 0,
}
public enum game_phrases
{
PHASE_DRAW = 0x01,
PHASE_STANDBY = 0x02,
PHASE_MAIN1 = 0x04,
PHASE_BATTLE_START = 0x08,
PHASE_BATTLE_STEP = 0x10,
PHASE_DAMAGE = 0x20,
PHASE_DAMAGE_CAL = 0x40,
PHASE_BATTLE = 0x80,
PHASE_MAIN2 = 0x100,
PHASE_END = 0x200,
}
public enum TypeOfDuel
{
Normal = 0x01,
TAG = 0x20,
};
public enum StocMessage
{
GameMsg = 0x1,
ErrorMsg = 0x2,
SelectHand = 0x3,
SelectTp = 0x4,
HandResult = 0x5,
TpResult = 0x6,
ChangeSide = 0x7,
WaitingSide = 0x8,
CreateGame = 0x11,
JoinGame = 0x12,
TypeChange = 0x13,
LeaveGame = 0x14,
DuelStart = 0x15,
DuelEnd = 0x16,
Replay = 0x17,
TimeLimit = 0x18,
Chat = 0x19,
HsPlayerEnter = 0x20,
HsPlayerChange = 0x21,
HsWatchChange = 0x22,
jinglai=0x23,
chuqu=0x24
}
public enum CtosMessage
{
Response = 0x1,
UpdateDeck = 0x2,
HandResult = 0x3,
TpResult = 0x4,
PlayerInfo = 0x10,
CreateGame = 0x11,
JoinGame = 0x12,
LeaveGame = 0x13,
Surrender = 0x14,
TimeConfirm = 0x15,
Chat = 0x16,
HsToDuelist = 0x20,
HsToObserver = 0x21,
HsReady = 0x22,
HsNotReady = 0x23,
HsKick = 0x24,
HsStart = 0x25
}
public enum PlayerChange
{
Observe = 0x8,
Ready = 0x9,
NotReady = 0xA,
Leave = 0xB
}
\ No newline at end of file
fileFormatVersion: 2
guid: ea6ed957719c1004a8fe5cb92cdce947
timeCreated: 1480605666
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
//using System;
//using System.IO;
//using UnityEngine;
//public struct point
//{
// public bool me;
// public game_location location;
// public int index;
// public game_position position;
// public int overlay_index;
// public point(bool m, game_location l, int i, game_position p = game_position.POS_FACEDOWN_ATTACK, int o = 0)
// {
// me = m;
// location = l;
// index = i;
// position = p;
// overlay_index = o;
// }
//}
//public struct CardData
//{
// public Int64 code;
// public Int32 Ot;
// public Int64 Alias;
// public Int64 SetCode;
// public Int64 Type;
// public Int32 Attack;
// public Int32 Defense;
// public Int64 Level;
// public Int64 Race;
// public Int32 Attribute;
// public Int64 Category;
// public string Name;
// public string Desc;
// public string tail;
// public string[] Str;
// public long LeftScale;
// public long RightScale;
// public CardData(int a = 0)
// {
// code = 0;
// Ot = 0;
// Alias = 0;
// SetCode = 0;
// Type = 0;
// Attack = 0;
// Defense = 0;
// Level = 0;
// Race = 0;
// Attribute = 0;
// Category = 0;
// Name = "";
// Desc = "";
// Str = new string[0];
// LeftScale = 0;
// RightScale = 0;
// tail = "";
// }
//}
fileFormatVersion: 2
guid: 34feabd62902b19489d8e3e2fe27d886
timeCreated: 1469113965
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
...@@ -10,30 +10,30 @@ ...@@ -10,30 +10,30 @@
// public static string get_attribute_string(long a) // public static string get_attribute_string(long a)
// { // {
// string r = ""; // string r = "";
// if (differ(a, (long)game_attributes.ATTRIBUTE_EARTH)) r += "地"; // if (differ(a, (long)CardAttribute.Earth)) r += "地";
// if (differ(a, (long)game_attributes.ATTRIBUTE_WATER)) r += "水"; // if (differ(a, (long)CardAttribute.Water)) r += "水";
// if (differ(a, (long)game_attributes.ATTRIBUTE_FIRE)) r += "炎"; // if (differ(a, (long)CardAttribute.Fire)) r += "炎";
// if (differ(a, (long)game_attributes.ATTRIBUTE_WIND)) r += "风"; // if (differ(a, (long)CardAttribute.Wind)) r += "风";
// if (differ(a, (long)game_attributes.ATTRIBUTE_DARK)) r += "暗"; // if (differ(a, (long)CardAttribute.Dark)) r += "暗";
// if (differ(a, (long)game_attributes.ATTRIBUTE_LIGHT)) r += "光"; // if (differ(a, (long)CardAttribute.Light)) r += "光";
// if (differ(a, (long)game_attributes.ATTRIBUTE_DEVINE)) r += "神"; // if (differ(a, (long)CardAttribute.Devine)) r += "神";
// r += "属性"; // r += "属性";
// return r; // return r;
// } // }
// public static string get_type_string(int a) // public static string get_type_string(int a)
// { // {
// string r = ""; // string r = "";
// if (differ(a, (long)game_type.TYPE_MONSTER)) r += "怪物卡"; // if (differ(a, (long)CardType.Monster)) r += "怪物卡";
// if (differ(a, (long)game_type.TYPE_SPELL)) r += "魔法卡"; // if (differ(a, (long)CardType.Spell)) r += "魔法卡";
// if (differ(a, (long)game_type.TYPE_TRAP)) r += "陷阱卡"; // if (differ(a, (long)CardType.Trap)) r += "陷阱卡";
// return r; // return r;
// } // }
// public static string get_detailed_type_string(int a) // public static string get_detailed_type_string(int a)
// { // {
// string r = ""; // string r = "";
// if (differ(a, (long)game_type.TYPE_MONSTER)) r += "怪物卡"; // if (differ(a, (long)CardType.Monster)) r += "怪物卡";
// if (differ(a, (long)game_type.TYPE_SPELL)) r += "魔法卡"; // if (differ(a, (long)CardType.Spell)) r += "魔法卡";
// if (differ(a, (long)game_type.TYPE_TRAP)) r += "陷阱卡"; // if (differ(a, (long)CardType.Trap)) r += "陷阱卡";
// return r; // return r;
// } // }
// public static string get_race_string(long a) // public static string get_race_string(long a)
...@@ -79,25 +79,25 @@ ...@@ -79,25 +79,25 @@
// } // }
// switch (p.location) // switch (p.location)
// { // {
// case game_location.LOCATION_DECK: // case CardLocation.Deck:
// re += "卡组中的"; // re += "卡组中的";
// break; // break;
// case game_location.LOCATION_EXTRA: // case CardLocation.Extra:
// re += "额外卡组中的"; // re += "额外卡组中的";
// break; // break;
// case game_location.LOCATION_GRAVE: // case CardLocation.Grave:
// re += "墓地中的"; // re += "墓地中的";
// break; // break;
// case game_location.LOCATION_HAND: // case CardLocation.Hand:
// re += "手上的"; // re += "手上的";
// break; // break;
// case game_location.LOCATION_MZONE: // case CardLocation.MonsterZone:
// re += "前场的"; // re += "前场的";
// break; // break;
// case game_location.LOCATION_REMOVED: // case CardLocation.Hand:
// re += "被除外的"; // re += "被除外的";
// break; // break;
// case game_location.LOCATION_SZONE: // case CardLocation.SpellZone:
// re += "后场的"; // re += "后场的";
// break; // break;
// } // }
...@@ -108,28 +108,28 @@ ...@@ -108,28 +108,28 @@
// } // }
// switch (p.position) // switch (p.position)
// { // {
// case game_position.POS_FACEDOWN_ATTACK: // case CardPosition.FaceDownAttack:
// re += "(里攻)"; // re += "(里攻)";
// break; // break;
// case game_position.POS_FACEDOWN_DEFENSE: // case CardPosition.FaceDown_DEFENSE:
// re += "(里守)"; // re += "(里守)";
// break; // break;
// case game_position.POS_FACEUP_ATTACK: // case CardPosition.FaceUpAttack:
// re += "(表攻)"; // re += "(表攻)";
// break; // break;
// case game_position.POS_FACEUP_DEFENSE: // case CardPosition.FaceUp_DEFENSE:
// re += "(表守)"; // re += "(表守)";
// break; // break;
// } // }
// if (p.location == game_location.LOCATION_UNKNOWN) re = "(未知区域)"; // if (p.location == CardLocation.Unknown) re = "(未知区域)";
// return re; // return re;
// } // }
// public static string get_name_string(CardData data) // public static string get_name_string(CardData data)
// { // {
// string re = ""; // string re = "";
// if (differ(data.Type, (long)game_type.TYPE_MONSTER)) re += "[ff8000]"+data.Name; // if (differ(data.Type, (long)CardType.Monster)) re += "[ff8000]"+data.Name;
// else if (differ(data.Type, (long)game_type.TYPE_SPELL)) re += "[7FFF00]" + data.Name; // else if (differ(data.Type, (long)CardType.Spell)) re += "[7FFF00]" + data.Name;
// else if (differ(data.Type, (long)game_type.TYPE_TRAP)) re += "[dda0dd]" + data.Name; // else if (differ(data.Type, (long)CardType.Trap)) re += "[dda0dd]" + data.Name;
// else re += "[ff8000]" + data.Name; // else re += "[ff8000]" + data.Name;
// re += "[-]"; // re += "[-]";
// return re; // return re;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment