Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOProUnity_V2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
perfectdicky
YGOProUnity_V2
Commits
ea749636
Commit
ea749636
authored
Apr 10, 2019
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format deckmanager code
parent
8ae57b1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
64 deletions
+49
-64
Assets/SibylSystem/deckManager/DeckManager.cs
Assets/SibylSystem/deckManager/DeckManager.cs
+49
-64
No files found.
Assets/SibylSystem/deckManager/DeckManager.cs
View file @
ea749636
...
...
@@ -646,7 +646,17 @@ public class DeckManager : ServantWithCardDescription
UIInput_search
.
isSelected
=
true
;
}
public YGOSharp.Banlist currentBanlist = null;
public
YGOSharp
.
Banlist
currentBanlist
=
null
;
bool
checkBanlistAvail
(
int
cardid
)
{
return
deck
.
GetCardCount
(
cardid
)
<
currentBanlist
.
GetQuantity
(
cardid
);
}
bool
isBanned
(
int
cardid
)
{
return
currentBanlist
.
GetQuantity
(
cardid
)
==
0
;
}
List
<
YGOSharp
.
Card
>
PrintedResult
=
new
List
<
YGOSharp
.
Card
>();
...
...
@@ -1228,15 +1238,15 @@ public class DeckManager : ServantWithCardDescription
public
override
void
ES_HoverOverGameObject
(
GameObject
gameObject
)
{
MonoCardInDeckManager
MonoCardInDeckManager_
= gameObject.GetComponent<MonoCardInDeckManager>();
if (
MonoCardInDeckManager_
!= null)
MonoCardInDeckManager
cardInDeck
=
gameObject
.
GetComponent
<
MonoCardInDeckManager
>();
if
(
cardInDeck
!=
null
)
{
((CardDescription)(Program.I().cardDescription)).setData(
MonoCardInDeckManager_
.cardData, GameTextureManager.myBack);
((
CardDescription
)(
Program
.
I
().
cardDescription
)).
setData
(
cardInDeck
.
cardData
,
GameTextureManager
.
myBack
);
}
cardPicLoader card
PicLoader_
= gameObject.GetComponent<cardPicLoader>();
if (card
PicLoader_
!= null)
cardPicLoader
card
InSearchResult
=
gameObject
.
GetComponent
<
cardPicLoader
>();
if
(
card
InSearchResult
!=
null
)
{
((CardDescription)(Program.I().cardDescription)).setData(card
PicLoader_
.data, GameTextureManager.myBack);
((
CardDescription
)(
Program
.
I
().
cardDescription
)).
setData
(
card
InSearchResult
.
data
,
GameTextureManager
.
myBack
);
}
}
...
...
@@ -1256,15 +1266,15 @@ public class DeckManager : ServantWithCardDescription
}
goLast
=
gameObject
;
timeLastDown
=
Program
.
TimePassed
();
MonoCardInDeckManager
MonoCardInDeckManager_
= gameObject.GetComponent<MonoCardInDeckManager>();
cardPicLoader card
PicLoader_
= gameObject.GetComponent<cardPicLoader>();
if (
MonoCardInDeckManager_ != null && !MonoCardInDeckManager_
.dying)
MonoCardInDeckManager
cardInDeck
=
gameObject
.
GetComponent
<
MonoCardInDeckManager
>();
cardPicLoader
card
InSearchResult
=
gameObject
.
GetComponent
<
cardPicLoader
>();
if
(
cardInDeck
!=
null
&&
!
cardInDeck
.
dying
)
{
if (doubleClick && condition == Condition.editDeck &&
deck.GetCardCount(MonoCardInDeckManager_.cardData.Id) < currentBanlist.GetQuantity(MonoCardInDeckManager_
.cardData.Id))
if
(
doubleClick
&&
condition
==
Condition
.
editDeck
&&
checkBanlistAvail
(
cardInDeck
.
cardData
.
Id
))
{
MonoCardInDeckManager
card
=
createCard
();
card.transform.position =
MonoCardInDeckManager_
.transform.position;
MonoCardInDeckManager_
.cardData.cloneTo(card.cardData);
card
.
transform
.
position
=
cardInDeck
.
transform
.
position
;
cardInDeck
.
cardData
.
cloneTo
(
card
.
cardData
);
card
.
gameObject
.
layer
=
16
;
deck
.
IMain
.
Add
(
card
);
deckDirty
=
true
;
...
...
@@ -1273,21 +1283,21 @@ public class DeckManager : ServantWithCardDescription
}
else
{
cardInDragging =
MonoCardInDeckManager_
;
MonoCardInDeckManager_
.beginDrag();
cardInDragging
=
cardInDeck
;
cardInDeck
.
beginDrag
();
}
}
else if (card
PicLoader_
!= null)
else
if
(
card
InSearchResult
!=
null
)
{
if
(
condition
==
Condition
.
editDeck
)
{
if (
deck.GetCardCount(cardPicLoader_.data.Id) < currentBanlist.GetQuantity(cardPicLoader_
.data.Id))
if
(
checkBanlistAvail
(
cardInSearchResult
.
data
.
Id
))
{
if ((card
PicLoader_
.data.Type & (UInt32)CardType.Token) == 0)
if
((
card
InSearchResult
.
data
.
Type
&
(
UInt32
)
CardType
.
Token
)
==
0
)
{
MonoCardInDeckManager
card
=
createCard
();
card
.
transform
.
position
=
card
.
getGoodPosition
(
4
);
card.cardData = card
PicLoader_
.data;
card
.
cardData
=
card
InSearchResult
.
data
;
card
.
gameObject
.
layer
=
16
;
deck
.
IMain
.
Add
(
card
);
cardInDragging
=
card
;
...
...
@@ -1324,61 +1334,52 @@ public class DeckManager : ServantWithCardDescription
{
if
(
condition
==
Condition
.
editDeck
)
{
MonoCardInDeckManager
MonoCardInDeckManager_
= Program.pointedGameObject.GetComponent<MonoCardInDeckManager>();
if (
MonoCardInDeckManager_
!= null)
MonoCardInDeckManager
cardInDeck
=
Program
.
pointedGameObject
.
GetComponent
<
MonoCardInDeckManager
>();
if
(
cardInDeck
!=
null
)
{
MonoCardInDeckManager_
.killIt();
cardInDeck
.
killIt
();
ArrangeObjectDeck
(
true
);
ShowObjectDeck
();
}
cardPicLoader card
PicLoader_
= Program.pointedGameObject.GetComponent<cardPicLoader>();
if (card
PicLoader_
!= null)
cardPicLoader
card
InSearchResult
=
Program
.
pointedGameObject
.
GetComponent
<
cardPicLoader
>();
if
(
card
InSearchResult
!=
null
)
{
CreateMonoCard(card
PicLoader_
.data);
CreateMonoCard
(
card
InSearchResult
.
data
);
ShowObjectDeck
();
}
}
else
{
MonoCardInDeckManager
MonoCardInDeckManager_
= Program.pointedGameObject.GetComponent<MonoCardInDeckManager>();
if (
MonoCardInDeckManager_
!= null)
MonoCardInDeckManager
cardInDeck
=
Program
.
pointedGameObject
.
GetComponent
<
MonoCardInDeckManager
>();
if
(
cardInDeck
!=
null
)
{
bool
isSide
=
false
;
for
(
int
i
=
0
;
i
<
deck
.
ISide
.
Count
;
i
++)
{
if (
MonoCardInDeckManager_
== deck.ISide[i])
if
(
cardInDeck
==
deck
.
ISide
[
i
])
{
isSide
=
true
;
}
}
if
(
isSide
)
{
if (
(MonoCardInDeckManager_.cardData.Type & (UInt32)CardType.Fusion) > 0
||
(MonoCardInDeckManager_.cardData.Type & (UInt32)CardType.Synchro) > 0
||
(MonoCardInDeckManager_.cardData.Type & (UInt32)CardType.Xyz) > 0
||
(MonoCardInDeckManager_.cardData.Type & (UInt32)CardType.Link) > 0
)
if
(
cardInDeck
.
cardData
.
IsExtraCard
())
{
deck.IExtra.Add(
MonoCardInDeckManager_
);
deck.ISide.Remove(
MonoCardInDeckManager_
);
deck
.
IExtra
.
Add
(
cardInDeck
);
deck
.
ISide
.
Remove
(
cardInDeck
);
}
else
{
deck.IMain.Add(
MonoCardInDeckManager_
);
deck.ISide.Remove(
MonoCardInDeckManager_
);
deck
.
IMain
.
Add
(
cardInDeck
);
deck
.
ISide
.
Remove
(
cardInDeck
);
}
}
else
{
deck.ISide.Add(
MonoCardInDeckManager_
);
deck.IMain.Remove(
MonoCardInDeckManager_
);
deck.IExtra.Remove(
MonoCardInDeckManager_
);
deck
.
ISide
.
Add
(
cardInDeck
);
deck
.
IMain
.
Remove
(
cardInDeck
);
deck
.
IExtra
.
Remove
(
cardInDeck
);
}
deckDirty = true;
ShowObjectDeck
();
}
}
...
...
@@ -1387,21 +1388,13 @@ public class DeckManager : ServantWithCardDescription
private
void
CreateMonoCard
(
YGOSharp
.
Card
data
)
{
if (
deck.GetCardCount(data.Id) < currentBanlist.GetQuantity
(data.Id))
if
(
checkBanlistAvail
(
data
.
Id
))
{
MonoCardInDeckManager
card
=
createCard
();
card
.
transform
.
position
=
card
.
getGoodPosition
(
4
);
card
.
cardData
=
data
;
card
.
gameObject
.
layer
=
16
;
if (
(data.Type & (UInt32)CardType.Fusion) > 0
||
(data.Type & (UInt32)CardType.Synchro) > 0
||
(data.Type & (UInt32)CardType.Xyz) > 0
||
(data.Type & (UInt32)CardType.Link) > 0
)
if
(
data
.
IsExtraCard
())
{
deck
.
IExtra
.
Add
(
card
);
deck
.
Extra
.
Add
(
card
.
cardData
.
Id
);
...
...
@@ -1581,15 +1574,7 @@ public class DeckManager : ServantWithCardDescription
{
if
(
p
.
z
>
-
8
)
{
if (
(deckTemp[i].cardData.Type & (UInt32)CardType.Fusion) > 0
||
(deckTemp[i].cardData.Type & (UInt32)CardType.Synchro) > 0
||
(deckTemp[i].cardData.Type & (UInt32)CardType.Xyz) > 0
||
(deckTemp[i].cardData.Type & (UInt32)CardType.Link) > 0
)
if
(
deckTemp
[
i
].
cardData
.
IsExtraCard
())
{
deck
.
IExtra
.
Add
(
deckTemp
[
i
]);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment