Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro2
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
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
nanahira
ygopro2
Commits
fb815cfe
Commit
fb815cfe
authored
Apr 10, 2019
by
mercury233
Committed by
Unicorn369
Apr 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format deckmanager code
parent
f5b446e0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
88 deletions
+61
-88
Assets/SibylSystem/deckManager/DeckManager.cs
Assets/SibylSystem/deckManager/DeckManager.cs
+61
-88
No files found.
Assets/SibylSystem/deckManager/DeckManager.cs
View file @
fb815cfe
...
...
@@ -655,6 +655,16 @@ public class DeckManager : ServantWithCardDescription
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
>();
void
print
(
List
<
YGOSharp
.
Card
>
result
)
...
...
@@ -1257,15 +1267,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
);
}
}
...
...
@@ -1285,15 +1295,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
;
...
...
@@ -1302,21 +1312,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
;
...
...
@@ -1353,61 +1363,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
();
}
}
...
...
@@ -1416,26 +1417,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
(
Input
.
GetKey
(
KeyCode
.
LeftShift
)
||
(
Input
.
GetKey
(
KeyCode
.
RightShift
)))
{
deck
.
ISide
.
Add
(
card
);
deck
.
Side
.
Add
(
card
.
cardData
.
Id
);
}
else
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
);
...
...
@@ -1497,33 +1485,26 @@ public class DeckManager : ServantWithCardDescription
{
switch
(
flag
)
{
case
3
:
case
1
:
{
deck
.
Side
.
Add
(
code
);
deck
.
Deck_O
.
Side
.
Add
(
code
);
deck
.
Main
.
Add
(
code
);
deck
.
Deck_O
.
Main
.
Add
(
code
);
}
break
;
default
:
{
YGOSharp
.
Card
card
=
YGOSharp
.
CardsManager
.
Get
(
code
);
if
((
card
.
Type
&
(
UInt32
)
CardType
.
Fusion
)
>
0
||
(
card
.
Type
&
(
UInt32
)
CardType
.
Synchro
)
>
0
||
(
card
.
Type
&
(
UInt32
)
CardType
.
Xyz
)
>
0
||
(
card
.
Type
&
(
UInt32
)
CardType
.
Link
)
>
0
)
case
2
:
{
deck
.
Extra
.
Add
(
code
);
deck
.
Deck_O
.
Extra
.
Add
(
code
);
}
else
break
;
case
3
:
{
deck
.
Main
.
Add
(
code
);
deck
.
Deck_O
.
Main
.
Add
(
code
);
}
deck
.
Side
.
Add
(
code
);
deck
.
Deck_O
.
Side
.
Add
(
code
);
}
break
;
default
:
break
;
}
}
}
...
...
@@ -1622,15 +1603,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