From fc302f8805f781f880b18cc2fb4e03b363d2a42d Mon Sep 17 00:00:00 2001 From: Brad Date: Sat, 16 Mar 2024 14:27:47 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=9A=AB=E5=AD=98=E7=9B=AE=E5=89=8D?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Client/Client.csproj | 2 +- Client/Pages/Gaming/Components/ChatBox.razor | 3 + .../Pages/Gaming/Components/ChatBox.razor.cs | 5 + .../Pages/Gaming/Components/ChatBox.razor.css | 9 ++ .../Pages/Gaming/Components/GameRound.razor | 11 ++ .../Gaming/Components/GameRound.razor.cs | 5 + .../Gaming/Components/GameRound.razor.css | 84 +++++++++++++ Client/Pages/Gaming/Components/Go.razor | 32 +++++ Client/Pages/Gaming/Components/Go.razor.cs | 5 + Client/Pages/Gaming/Components/Go.razor.css | 40 +++++++ .../Pages/Gaming/Components/PlayerInfo.razor | 24 ++++ .../Gaming/Components/PlayerInfo.razor.cs | 5 + .../Gaming/Components/PlayerInfo.razor.css | 68 +++++++++++ .../Gaming/Components/PlayerRankList.razor | 66 ++++++++++ .../Gaming/Components/PlayerRankList.razor.cs | 5 + .../Components/PlayerRankList.razor.css | 113 ++++++++++++++++++ Client/Pages/Gaming/Components/Settings.razor | 6 + .../Pages/Gaming/Components/Settings.razor.cs | 5 + .../Gaming/Components/Settings.razor.css | 52 ++++++++ Client/Pages/Gaming/GameMap.razor | 3 + Client/Pages/Gaming/GameMap.razor.cs | 5 + Client/Pages/Gaming/GameMap.razor.css | 9 ++ Client/Pages/Gaming/GamingPage.razor | 15 ++- Client/Pages/Gaming/GamingPage.razor.css | 50 ++++++++ Client/Properties/launchSettings.json | 4 +- .../images/gamepage/AutoButtun_Off.svg | 5 + .../wwwroot/images/gamepage/AutoButtun_On.svg | 5 + .../{GO Default.svg => Go_Default.svg} | 0 Client/wwwroot/images/gamepage/Go_Pressed.svg | 20 ++++ Client/wwwroot/images/gamepage/Icon_Host.svg | 4 + .../images/gamepage/Icon_Information.svg | 4 + Client/wwwroot/images/gamepage/Icon_Leave.svg | 4 + .../wwwroot/images/gamepage/Icon_Setting.svg | 5 + .../wwwroot/images/gamepage/Ranking_Host.svg | 35 ++++++ .../wwwroot/images/gamepage/Ranking_Item.svg | 52 ++++++++ .../wwwroot/images/gamepage/alarm_clock.svg | 5 + Client/wwwroot/images/gamepage/background.svg | 9 ++ .../images/gamepage/icon_mini_home.svg | 4 + .../images/gamepage/icon_mini_money.svg | 5 + Client/wwwroot/images/gamepage/round.svg | 24 ++-- 40 files changed, 792 insertions(+), 15 deletions(-) create mode 100644 Client/Pages/Gaming/Components/ChatBox.razor create mode 100644 Client/Pages/Gaming/Components/ChatBox.razor.cs create mode 100644 Client/Pages/Gaming/Components/ChatBox.razor.css create mode 100644 Client/Pages/Gaming/Components/GameRound.razor create mode 100644 Client/Pages/Gaming/Components/GameRound.razor.cs create mode 100644 Client/Pages/Gaming/Components/GameRound.razor.css create mode 100644 Client/Pages/Gaming/Components/Go.razor create mode 100644 Client/Pages/Gaming/Components/Go.razor.cs create mode 100644 Client/Pages/Gaming/Components/Go.razor.css create mode 100644 Client/Pages/Gaming/Components/PlayerInfo.razor create mode 100644 Client/Pages/Gaming/Components/PlayerInfo.razor.cs create mode 100644 Client/Pages/Gaming/Components/PlayerInfo.razor.css create mode 100644 Client/Pages/Gaming/Components/PlayerRankList.razor create mode 100644 Client/Pages/Gaming/Components/PlayerRankList.razor.cs create mode 100644 Client/Pages/Gaming/Components/PlayerRankList.razor.css create mode 100644 Client/Pages/Gaming/Components/Settings.razor create mode 100644 Client/Pages/Gaming/Components/Settings.razor.cs create mode 100644 Client/Pages/Gaming/Components/Settings.razor.css create mode 100644 Client/Pages/Gaming/GameMap.razor create mode 100644 Client/Pages/Gaming/GameMap.razor.cs create mode 100644 Client/Pages/Gaming/GameMap.razor.css create mode 100644 Client/Pages/Gaming/GamingPage.razor.css create mode 100644 Client/wwwroot/images/gamepage/AutoButtun_Off.svg create mode 100644 Client/wwwroot/images/gamepage/AutoButtun_On.svg rename Client/wwwroot/images/gamepage/{GO Default.svg => Go_Default.svg} (100%) create mode 100644 Client/wwwroot/images/gamepage/Go_Pressed.svg create mode 100644 Client/wwwroot/images/gamepage/Icon_Host.svg create mode 100644 Client/wwwroot/images/gamepage/Icon_Information.svg create mode 100644 Client/wwwroot/images/gamepage/Icon_Leave.svg create mode 100644 Client/wwwroot/images/gamepage/Icon_Setting.svg create mode 100644 Client/wwwroot/images/gamepage/Ranking_Host.svg create mode 100644 Client/wwwroot/images/gamepage/Ranking_Item.svg create mode 100644 Client/wwwroot/images/gamepage/alarm_clock.svg create mode 100644 Client/wwwroot/images/gamepage/background.svg create mode 100644 Client/wwwroot/images/gamepage/icon_mini_home.svg create mode 100644 Client/wwwroot/images/gamepage/icon_mini_money.svg diff --git a/Client/Client.csproj b/Client/Client.csproj index f627b15..088e690 100644 --- a/Client/Client.csproj +++ b/Client/Client.csproj @@ -1,4 +1,4 @@ - + net8.0 diff --git a/Client/Pages/Gaming/Components/ChatBox.razor b/Client/Pages/Gaming/Components/ChatBox.razor new file mode 100644 index 0000000..2aa4588 --- /dev/null +++ b/Client/Pages/Gaming/Components/ChatBox.razor @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Client/Pages/Gaming/Components/ChatBox.razor.cs b/Client/Pages/Gaming/Components/ChatBox.razor.cs new file mode 100644 index 0000000..5e48cb6 --- /dev/null +++ b/Client/Pages/Gaming/Components/ChatBox.razor.cs @@ -0,0 +1,5 @@ +namespace Client.Pages.Gaming.Components; + +public partial class ChatBox +{ +} diff --git a/Client/Pages/Gaming/Components/ChatBox.razor.css b/Client/Pages/Gaming/Components/ChatBox.razor.css new file mode 100644 index 0000000..af9d8b4 --- /dev/null +++ b/Client/Pages/Gaming/Components/ChatBox.razor.css @@ -0,0 +1,9 @@ + +.ChatBox { + position: absolute; + width: calc(603 * var(--unit)); + height: calc(180 * var(--unit)); + top: calc(888 * var(--unit)); + left: calc(32 * var(--unit)); + background-color: coral; +} diff --git a/Client/Pages/Gaming/Components/GameRound.razor b/Client/Pages/Gaming/Components/GameRound.razor new file mode 100644 index 0000000..8f48574 --- /dev/null +++ b/Client/Pages/Gaming/Components/GameRound.razor @@ -0,0 +1,11 @@ +
+ +
+
+ 10:00 +
+
+ 0回合 +
+
+
\ No newline at end of file diff --git a/Client/Pages/Gaming/Components/GameRound.razor.cs b/Client/Pages/Gaming/Components/GameRound.razor.cs new file mode 100644 index 0000000..3a237ea --- /dev/null +++ b/Client/Pages/Gaming/Components/GameRound.razor.cs @@ -0,0 +1,5 @@ +namespace Client.Pages.Gaming.Components; + +public partial class GameRound +{ +} diff --git a/Client/Pages/Gaming/Components/GameRound.razor.css b/Client/Pages/Gaming/Components/GameRound.razor.css new file mode 100644 index 0000000..3812fc8 --- /dev/null +++ b/Client/Pages/Gaming/Components/GameRound.razor.css @@ -0,0 +1,84 @@ + +.GameRound { + position: absolute; + width: calc(170 * var(--unit)); + height: calc(135 * var(--unit)); + top: calc(24 * var(--unit)); + left: calc(32 * var(--unit)); +} + +.Round_Info { + position: absolute; + width: calc(170 * var(--unit)); + height: calc(135 * var(--unit)); + top: 0; + left: 0; + /*background-image: url('./images/gamepage/Round.svg');*/ + background-size: cover; + background-position: center; +} + +.TimeBox { + width: calc(170 * var(--unit)); + height: calc(52 * var(--unit)); + background-color: #B67171; /* 底色 */ + border: calc(3 * var(--unit)) solid #5B5B5B; /* 方框邊框寬度和顏色 */ + border-bottom: none; /* 下方框邊框寬度和顏色*/ + border-top-left-radius: calc(10 * var(--unit)); /* 左上角方框圓角半徑 */ + border-top-right-radius: calc(10 * var(--unit)); /* 右上角方框圓角半徑 */ +} + + .TimeBox .Alarm_Clock { + position: absolute; + width: calc(24 * var(--unit)); + height: calc(24 * var(--unit)); + top: calc(15 * var(--unit)); + left: calc(30 * var(--unit)); + background-image: url('./images/gamepage/alarm_clock.svg'); + background-size: cover; + background-position: center; + } + + .TimeBox .Time_Str { + position: absolute; + width: calc(78 * var(--unit)); + height: calc(33 * var(--unit)); + top: calc(15 * var(--unit)); + left: calc(62 * var(--unit)); + color: white; + font-size: calc(24 * var(--unit)); + text-align: center; + } + +.RoundBox { + width: calc(170 * var(--unit)); + height: calc(77 * var(--unit)); + background-color: white; /* 底色 */ + border: calc(3 * var(--unit)) solid #5B5B5B; /* 方框邊框寬度和顏色 */ + border-top: none; /* 上方框線框寬度和顏色 */ + border-bottom-left-radius: calc(10 * var(--unit)); /* 右下角方框圓角半徑 */ + border-bottom-right-radius: calc(10 * var(--unit)); /* 右下角方框圓角半徑 */ +} + .RoundBox .Round_Str { + position: absolute; + color: #595959; + font-size: calc(20 * var(--unit)); + } + .RoundBox .Round_Str.Start { + top: calc(94 * var(--unit)); + left: calc(23 * var(--unit)); + } + .RoundBox .Round_Str.End { + top: calc(94 * var(--unit)); + left: calc(108 * var(--unit)); + } + .RoundBox .Round_Number { + position: absolute; + width: calc(59 * var(--unit)); + height: calc(58 * var(--unit)); + top: calc(67 * var(--unit)); + left: calc(46 * var(--unit)); + color: #595959; + font-size: calc(48 * var(--unit)); + text-align: center; + } \ No newline at end of file diff --git a/Client/Pages/Gaming/Components/Go.razor b/Client/Pages/Gaming/Components/Go.razor new file mode 100644 index 0000000..c5a29f8 --- /dev/null +++ b/Client/Pages/Gaming/Components/Go.razor @@ -0,0 +1,32 @@ + + + + + + + + \ No newline at end of file diff --git a/Client/Pages/Gaming/Components/Go.razor.cs b/Client/Pages/Gaming/Components/Go.razor.cs new file mode 100644 index 0000000..d1050a9 --- /dev/null +++ b/Client/Pages/Gaming/Components/Go.razor.cs @@ -0,0 +1,5 @@ +namespace Client.Pages.Gaming.Components; + +public partial class Go +{ +} diff --git a/Client/Pages/Gaming/Components/Go.razor.css b/Client/Pages/Gaming/Components/Go.razor.css new file mode 100644 index 0000000..4035667 --- /dev/null +++ b/Client/Pages/Gaming/Components/Go.razor.css @@ -0,0 +1,40 @@ + +.Go { + position: absolute; + width: calc(257 * var(--unit)); + height: calc(224 * var(--unit)); + top: calc(840 * var(--unit)); + left: calc(1632 * var(--unit)); + /*background-color: coral;*/ +} + +.GoBetton { + position: absolute; + width: calc(224 * var(--unit)); + height: calc(224 * var(--unit)); + top: 0; + left: 0; + background-image: url('./images/gamepage/Go_Default.svg'); + background-size: cover; + background-position: center; + + } + + .GoBetton.Pressed { + background-image: url('./images/gamepage/Go_Pressed.svg'); + } + +.AutoBetton { + position: absolute; + width: calc(72 * var(--unit)); + height: calc(32 * var(--unit)); + top: calc(177 * var(--unit)); + left: calc(185 * var(--unit)); + background-image: url('./images/gamepage/AutoButtun_Off.svg'); + background-size: cover; + background-position: center; +} + + .AutoBetton.Open { + background-image: url('./images/gamepage/AutoButtun_On.svg'); + } \ No newline at end of file diff --git a/Client/Pages/Gaming/Components/PlayerInfo.razor b/Client/Pages/Gaming/Components/PlayerInfo.razor new file mode 100644 index 0000000..d11352b --- /dev/null +++ b/Client/Pages/Gaming/Components/PlayerInfo.razor @@ -0,0 +1,24 @@ + +
+
+ 9,000 +
+
9,000
+
+
+ + 抵押清單 + +
    +
  • A
  • +
  • B
  • +
  • C
  • +
  • C
  • +
  • C
  • +
  • C
  • +
  • C
  • +
  • C
  • +
  • C
  • +
+
+
\ No newline at end of file diff --git a/Client/Pages/Gaming/Components/PlayerInfo.razor.cs b/Client/Pages/Gaming/Components/PlayerInfo.razor.cs new file mode 100644 index 0000000..67aeebc --- /dev/null +++ b/Client/Pages/Gaming/Components/PlayerInfo.razor.cs @@ -0,0 +1,5 @@ +namespace Client.Pages.Gaming.Components; + +public partial class PlayerInfo +{ +} diff --git a/Client/Pages/Gaming/Components/PlayerInfo.razor.css b/Client/Pages/Gaming/Components/PlayerInfo.razor.css new file mode 100644 index 0000000..681ee7b --- /dev/null +++ b/Client/Pages/Gaming/Components/PlayerInfo.razor.css @@ -0,0 +1,68 @@ + +.PlayerInfo { + display: inline-flex; + flex-direction: column; + position: absolute; + top: calc(213 * var(--unit)); + left: calc(1644 * var(--unit)); + border-radius: calc(20 * var(--unit)); /* 方框圓角半徑 */ + border: calc(4 * var(--unit)) solid white; /* 方框邊框寬度和顏色 */ + background-color: #5B5B5B; /* 底色 */ +} + + .PlayerInfo .money { + display: inline-flex; + flex-direction: row; + width: calc(206 * var(--unit)); + color: white; + font-size: calc(20 * var(--unit)); + margin-left: calc(10 * var(--unit)); + } + .PlayerInfo .money .icon { + width: calc(15 * var(--unit)); + height: calc(15 * var(--unit)); + background-image: url('./images/gamepage/icon_mini_money.svg'); + background-size: auto; + background-position: left bottom; + background-position-y: calc(5 * var(--unit)); + background-repeat: no-repeat; + } + +/* .PlayerInfo .Money::before { + content: ""; + width: calc(15 * var(--unit)); + height: calc(15 * var(--unit)); + margin-right: calc(4 * var(--unit)); + margin-bottom: calc(-3 * var(--unit)); + background-image: url('./images/gamepage/icon_mini_money.svg'); + background-size: cover; + background-position: center; + }*/ + + .PlayerInfo .TotalMoney { + display: inline-flex; + flex-direction: row; + width: calc(206 * var(--unit)); + color: white; + font-size: calc(20 * var(--unit)); + } + + .PlayerInfo .TotalMoney::before { + content: ""; + display: inline-block; + width: calc(15 * var(--unit)); + height: calc(15 * var(--unit)); + margin-right: calc(4 * var(--unit)); + margin-bottom: calc(-3 * var(--unit)); + background-image: url('./images/gamepage/icon_mini_home.svg'); + background-size: cover; + background-position: center; + } + + .PlayerInfo .MortgageList { +/* position: absolute;*/ + top: calc(121 * var(--unit)); + left: calc(25 * var(--unit)); + color: #D8C292; + font-size: 20px; + } diff --git a/Client/Pages/Gaming/Components/PlayerRankList.razor b/Client/Pages/Gaming/Components/PlayerRankList.razor new file mode 100644 index 0000000..2b504a4 --- /dev/null +++ b/Client/Pages/Gaming/Components/PlayerRankList.razor @@ -0,0 +1,66 @@ +
+
+
+
+
+ 1 +
+
+ Jason1 +
+
1,0000
+
9,000
+
+
+
+
+
+
+
+
+
+ 2 +
+
+ Jason2 +
+
1,0000
+
9,000
+
+
+
+
+
+
+
+
+
+ 3 +
+
+ Jason3 +
+
1,0000
+
9,000
+
+
+
+
+
+
+
+
+
+ 4 +
+
+ Jason4 +
+
1,0000
+
9,000
+
+
+
+
+
+
\ No newline at end of file diff --git a/Client/Pages/Gaming/Components/PlayerRankList.razor.cs b/Client/Pages/Gaming/Components/PlayerRankList.razor.cs new file mode 100644 index 0000000..87cb4f3 --- /dev/null +++ b/Client/Pages/Gaming/Components/PlayerRankList.razor.cs @@ -0,0 +1,5 @@ +namespace Client.Pages.Gaming.Components; + +public partial class PlayerList +{ +} diff --git a/Client/Pages/Gaming/Components/PlayerRankList.razor.css b/Client/Pages/Gaming/Components/PlayerRankList.razor.css new file mode 100644 index 0000000..e9a57c8 --- /dev/null +++ b/Client/Pages/Gaming/Components/PlayerRankList.razor.css @@ -0,0 +1,113 @@ + +.PlayerRankList { + position: absolute; + width: calc(200 * var(--unit)); + height: calc(355 * var(--unit)); + top: calc(194 * var(--unit)); + left: 0; +} + + .PlayerRankList .PlayerInfo { + position: relative; + width: calc(178 * var(--unit)); + height: calc(90 * var(--unit)); + border-radius: calc(20 * var(--unit)); /* 方框圓角半徑 */ + border: calc(4 * var(--unit)) solid #008227; /* 方框邊框寬度和顏色 */ + background-color: #5B5B5B; /* 底色 */ + } + .PlayerRankList .PlayerInfo .Rank { + position: absolute; + top: 0; + left: 0; + } + .PlayerRankList .PlayerInfo .Rank .Round { + position: absolute; + width: calc(24 * var(--unit)); + height: calc(24 * var(--unit)); + top: 0; + left: 0; + border-radius: 50%; /* 圓形 */ + border: calc(1 * var(--unit)) solid white; /* 外框 */ + background-color: #D8C292; /* 底色 */ + } + .PlayerRankList .PlayerInfo .Rank .Number { + position: absolute; + top: calc(5.5 * var(--unit)); + left: calc(9 * var(--unit)); + color: #5B5B5B; + font-size: calc(16 * var(--unit)); + text-align: center; + } + + .PlayerRankList .PlayerInfo .Name { + position: relative; + width: calc(40 * var(--unit)); + height: calc(21 * var(--unit)); + top: 0; + left: calc(31 * var(--unit)); + color: white; + font-size: calc(20 * var(--unit)); + } + + .PlayerRankList .PlayerInfo .Icon { + position: absolute; + width: calc(60 * var(--unit)); + height: calc(50 * var(--unit)); + top: calc(25 * var(--unit)); + left: calc(16 * var(--unit)); + /*background-image: url('./images/roles/avatars/小美頭.svg');*/ + background-size: cover; + background-position: center; + } + .PlayerRankList .PlayerInfo .Icon.baby { + background-image: url('images/roles/avatars/老人頭.svg'); + } + .PlayerRankList .PlayerInfo .Icon.oldman { + background-image: url('images/roles/avatars/寶寶頭.svg'); + } + .PlayerRankList .PlayerInfo .Icon.dai { + background-image: url('images/roles/avatars/阿呆頭.svg'); + } + .PlayerRankList .PlayerInfo .Icon.mei { + background-image: url('images/roles/avatars/小美頭.svg'); + } + + .PlayerRankList .PlayerInfo .Money { + position: absolute; + width: calc(94 * var(--unit)); + top: calc(30 * var(--unit)); + left: calc(84 * var(--unit)); + color: white; + font-size: calc(20 * var(--unit)); + } + .PlayerRankList .PlayerInfo .Money::before { + content: ""; + display: inline-block; + width: calc(15 * var(--unit)); + height: calc(15 * var(--unit)); + margin-right: calc(4 * var(--unit)); + margin-bottom: calc(-3 * var(--unit)); + background-image: url('./images/gamepage/icon_mini_money.svg'); + background-size: cover; + background-position: center; + } + + .PlayerRankList .PlayerInfo .TotalMoney { + position: absolute; + width: calc(94 * var(--unit)); + top: calc(54 * var(--unit)); + left: calc(84 * var(--unit)); + color: white; + font-size: calc(20 * var(--unit)); + } + .PlayerRankList .PlayerInfo .TotalMoney::before { + content: ""; + display: inline-block; + width: calc(15 * var(--unit)); + height: calc(15 * var(--unit)); + margin-right: calc(4 * var(--unit)); + margin-bottom: calc(-3 * var(--unit)); + background-image: url('./images/gamepage/icon_mini_home.svg'); + background-size: cover; + background-position: center; + } diff --git a/Client/Pages/Gaming/Components/Settings.razor b/Client/Pages/Gaming/Components/Settings.razor new file mode 100644 index 0000000..d591066 --- /dev/null +++ b/Client/Pages/Gaming/Components/Settings.razor @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Client/Pages/Gaming/Components/Settings.razor.cs b/Client/Pages/Gaming/Components/Settings.razor.cs new file mode 100644 index 0000000..c3719c3 --- /dev/null +++ b/Client/Pages/Gaming/Components/Settings.razor.cs @@ -0,0 +1,5 @@ +namespace Client.Pages.Gaming.Components; + +public partial class Settings +{ +} diff --git a/Client/Pages/Gaming/Components/Settings.razor.css b/Client/Pages/Gaming/Components/Settings.razor.css new file mode 100644 index 0000000..424de6e --- /dev/null +++ b/Client/Pages/Gaming/Components/Settings.razor.css @@ -0,0 +1,52 @@ + +.Settings { + position: absolute; + width: calc(228 * var(--unit)); + height: calc(48 * var(--unit)); + top: calc(32 * var(--unit)); + left: calc(1660 * var(--unit)); +} + +.HostBetton { + position: absolute; + width: calc(48 * var(--unit)); + height: calc(48 * var(--unit)); + top: 0; + left: 0; + background-image: url('./images/gamepage/Icon_Host.svg'); + background-size: cover; + background-position: center; +} + +.InformationBetton { + position: absolute; + width: calc(48 * var(--unit)); + height: calc(48 * var(--unit)); + top: 0; + left: calc(60 * var(--unit)); + background-image: url('./images/gamepage/Icon_Information.svg'); + background-size: cover; + background-position: center; +} + +.SettingBetton { + position: absolute; + width: calc(48 * var(--unit)); + height: calc(48 * var(--unit)); + top: 0; + left: calc(120 * var(--unit)); + background-image: url('./images/gamepage/Icon_Setting.svg'); + background-size: cover; + background-position: center; +} + +.LeaveBetton { + position: absolute; + width: calc(48 * var(--unit)); + height: calc(48 * var(--unit)); + top: 0; + left: calc(180 * var(--unit)); + background-image: url('./images/gamepage/Icon_Leave.svg'); + background-size: cover; + background-position: center; +} \ No newline at end of file diff --git a/Client/Pages/Gaming/GameMap.razor b/Client/Pages/Gaming/GameMap.razor new file mode 100644 index 0000000..076c9ba --- /dev/null +++ b/Client/Pages/Gaming/GameMap.razor @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Client/Pages/Gaming/GameMap.razor.cs b/Client/Pages/Gaming/GameMap.razor.cs new file mode 100644 index 0000000..a8aaedc --- /dev/null +++ b/Client/Pages/Gaming/GameMap.razor.cs @@ -0,0 +1,5 @@ +namespace Client.Pages.Gaming; + +public partial class GameMap +{ +} diff --git a/Client/Pages/Gaming/GameMap.razor.css b/Client/Pages/Gaming/GameMap.razor.css new file mode 100644 index 0000000..5462356 --- /dev/null +++ b/Client/Pages/Gaming/GameMap.razor.css @@ -0,0 +1,9 @@ + +.content.map { + position: absolute; + width: calc(1469 * var(--unit)); + height: calc(851 * var(--unit)); + top: calc(113 * var(--unit)); + left: calc(240 * var(--unit)); + background-color: rgb(226, 129, 129); +} diff --git a/Client/Pages/Gaming/GamingPage.razor b/Client/Pages/Gaming/GamingPage.razor index 67439d6..1f18133 100644 --- a/Client/Pages/Gaming/GamingPage.razor +++ b/Client/Pages/Gaming/GamingPage.razor @@ -1 +1,14 @@ -
123
\ No newline at end of file +@page "/GamingPage" +@using Client.Pages.Gaming.Components + +
+ + + + + + + + + +
\ No newline at end of file diff --git a/Client/Pages/Gaming/GamingPage.razor.css b/Client/Pages/Gaming/GamingPage.razor.css new file mode 100644 index 0000000..53f0d16 --- /dev/null +++ b/Client/Pages/Gaming/GamingPage.razor.css @@ -0,0 +1,50 @@ +/*.menu-l { + margin: 0; + float: left; + width: 20%; + height: 100dvh; + background-color: dodgerblue; +} + +.content { + margin: 0; + float: left; + width: 60%; + height: 100dvh;*/ + /*background-color: rgb(226, 129, 129);*/ +/*} + +.menu-r { + margin: 0; + float: left; + width: 20%; + height: 100dvh;*/ + /*background-color: cornflowerblue;*/ +/*}*/ + +.background { + margin: 0; + width: calc(1920 * var(--unit)); + height: calc(1080 * var(--unit)); + background-image: url('./images/gamepage/background.svg'); + background-size: cover; + background-position: center; +} + +.menu-l { + position: absolute; + width: calc(1469 * var(--unit)); + height: calc(851 * var(--unit)); + top: calc(113 * var(--unit)); + left: calc(240 * var(--unit)); + background-color: rgb(226, 129, 129); +} + +.content.map { + position: absolute; + width: calc(1469 * var(--unit)); + height: calc(851 * var(--unit)); + top: calc(113 * var(--unit)); + left: calc(240 * var(--unit)); + background-color: rgb(226, 129, 129); +} \ No newline at end of file diff --git a/Client/Properties/launchSettings.json b/Client/Properties/launchSettings.json index 15350af..d274eed 100644 --- a/Client/Properties/launchSettings.json +++ b/Client/Properties/launchSettings.json @@ -11,7 +11,7 @@ "dotnetRunMessages": true, "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "applicationUrl": "http://localhost:5184/dev-page", + "applicationUrl": "http://localhost:5184/GamingPage", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } @@ -22,7 +22,7 @@ "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "applicationUrl": "https://localhost:7047;http://localhost:5184", - "launchUrl": "https://localhost:7047/dev-page", + "launchUrl": "https://localhost:7047/GamingPage", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/Client/wwwroot/images/gamepage/AutoButtun_Off.svg b/Client/wwwroot/images/gamepage/AutoButtun_Off.svg new file mode 100644 index 0000000..ba134a7 --- /dev/null +++ b/Client/wwwroot/images/gamepage/AutoButtun_Off.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/Client/wwwroot/images/gamepage/AutoButtun_On.svg b/Client/wwwroot/images/gamepage/AutoButtun_On.svg new file mode 100644 index 0000000..5b8f5e4 --- /dev/null +++ b/Client/wwwroot/images/gamepage/AutoButtun_On.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/Client/wwwroot/images/gamepage/GO Default.svg b/Client/wwwroot/images/gamepage/Go_Default.svg similarity index 100% rename from Client/wwwroot/images/gamepage/GO Default.svg rename to Client/wwwroot/images/gamepage/Go_Default.svg diff --git a/Client/wwwroot/images/gamepage/Go_Pressed.svg b/Client/wwwroot/images/gamepage/Go_Pressed.svg new file mode 100644 index 0000000..3d8b15e --- /dev/null +++ b/Client/wwwroot/images/gamepage/Go_Pressed.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/Client/wwwroot/images/gamepage/Icon_Host.svg b/Client/wwwroot/images/gamepage/Icon_Host.svg new file mode 100644 index 0000000..520a68c --- /dev/null +++ b/Client/wwwroot/images/gamepage/Icon_Host.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Client/wwwroot/images/gamepage/Icon_Information.svg b/Client/wwwroot/images/gamepage/Icon_Information.svg new file mode 100644 index 0000000..3b4f8a7 --- /dev/null +++ b/Client/wwwroot/images/gamepage/Icon_Information.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Client/wwwroot/images/gamepage/Icon_Leave.svg b/Client/wwwroot/images/gamepage/Icon_Leave.svg new file mode 100644 index 0000000..a3a2da9 --- /dev/null +++ b/Client/wwwroot/images/gamepage/Icon_Leave.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Client/wwwroot/images/gamepage/Icon_Setting.svg b/Client/wwwroot/images/gamepage/Icon_Setting.svg new file mode 100644 index 0000000..301a248 --- /dev/null +++ b/Client/wwwroot/images/gamepage/Icon_Setting.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/Client/wwwroot/images/gamepage/Ranking_Host.svg b/Client/wwwroot/images/gamepage/Ranking_Host.svg new file mode 100644 index 0000000..fd7ae9e --- /dev/null +++ b/Client/wwwroot/images/gamepage/Ranking_Host.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Client/wwwroot/images/gamepage/Ranking_Item.svg b/Client/wwwroot/images/gamepage/Ranking_Item.svg new file mode 100644 index 0000000..5487f7e --- /dev/null +++ b/Client/wwwroot/images/gamepage/Ranking_Item.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Client/wwwroot/images/gamepage/alarm_clock.svg b/Client/wwwroot/images/gamepage/alarm_clock.svg new file mode 100644 index 0000000..0c648d4 --- /dev/null +++ b/Client/wwwroot/images/gamepage/alarm_clock.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/Client/wwwroot/images/gamepage/background.svg b/Client/wwwroot/images/gamepage/background.svg new file mode 100644 index 0000000..d679028 --- /dev/null +++ b/Client/wwwroot/images/gamepage/background.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Client/wwwroot/images/gamepage/icon_mini_home.svg b/Client/wwwroot/images/gamepage/icon_mini_home.svg new file mode 100644 index 0000000..6ef2058 --- /dev/null +++ b/Client/wwwroot/images/gamepage/icon_mini_home.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Client/wwwroot/images/gamepage/icon_mini_money.svg b/Client/wwwroot/images/gamepage/icon_mini_money.svg new file mode 100644 index 0000000..b393487 --- /dev/null +++ b/Client/wwwroot/images/gamepage/icon_mini_money.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/Client/wwwroot/images/gamepage/round.svg b/Client/wwwroot/images/gamepage/round.svg index f0501c4..f43cc80 100644 --- a/Client/wwwroot/images/gamepage/round.svg +++ b/Client/wwwroot/images/gamepage/round.svg @@ -1,13 +1,15 @@ - - - - + + + + - - - - - - - + + + + + + + + + From dd33d3fd7a23a3a633482f26b0bf9b4f8b1478f1 Mon Sep 17 00:00:00 2001 From: Brad Date: Thu, 9 May 2024 21:13:54 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=AA=BF=E6=95=B4=E7=95=AB=E9=9D=A2CSS?= =?UTF-8?q?=E6=8E=92=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Pages/Gaming/Components/PlayerInfo.razor | 33 ++++- .../Gaming/Components/PlayerInfo.razor.css | 87 ++++++------ .../Gaming/Components/PlayerRankList.razor | 76 +++++++---- .../Components/PlayerRankList.razor.css | 129 +++++++++--------- 4 files changed, 189 insertions(+), 136 deletions(-) diff --git a/Client/Pages/Gaming/Components/PlayerInfo.razor b/Client/Pages/Gaming/Components/PlayerInfo.razor index d11352b..fdbcc67 100644 --- a/Client/Pages/Gaming/Components/PlayerInfo.razor +++ b/Client/Pages/Gaming/Components/PlayerInfo.razor @@ -1,14 +1,18 @@ 
-
9,000
-
9,000
-
+
+ 9,000 +
+
+ 9,000 +
+
+
+ 抵押清單 +
- - 抵押清單 -
  • A
  • B
  • @@ -21,4 +25,19 @@
  • C
- \ No newline at end of file + + + \ No newline at end of file diff --git a/Client/Pages/Gaming/Components/PlayerInfo.razor.css b/Client/Pages/Gaming/Components/PlayerInfo.razor.css index 681ee7b..500312d 100644 --- a/Client/Pages/Gaming/Components/PlayerInfo.razor.css +++ b/Client/Pages/Gaming/Components/PlayerInfo.razor.css @@ -1,68 +1,79 @@ - -.PlayerInfo { - display: inline-flex; - flex-direction: column; +.PlayerInfo { position: absolute; top: calc(213 * var(--unit)); left: calc(1644 * var(--unit)); border-radius: calc(20 * var(--unit)); /* 方框圓角半徑 */ border: calc(4 * var(--unit)) solid white; /* 方框邊框寬度和顏色 */ background-color: #5B5B5B; /* 底色 */ + padding: 1rem; /* 4邊起始位置往內推一個字(16px) */ } - .PlayerInfo .money { - display: inline-flex; - flex-direction: row; - width: calc(206 * var(--unit)); - color: white; - font-size: calc(20 * var(--unit)); - margin-left: calc(10 * var(--unit)); + .PlayerInfo .withBalls::before, .PlayerInfo .withBalls::after { + content: ''; + display: inline-block; + position: absolute; + width: .5rem; + height: .5rem; + background-color: white; + border-radius: 50%; + transform: translateY(-50%); } - .PlayerInfo .money .icon { - width: calc(15 * var(--unit)); - height: calc(15 * var(--unit)); - background-image: url('./images/gamepage/icon_mini_money.svg'); - background-size: auto; - background-position: left bottom; - background-position-y: calc(5 * var(--unit)); - background-repeat: no-repeat; - } -/* .PlayerInfo .Money::before { - content: ""; - width: calc(15 * var(--unit)); - height: calc(15 * var(--unit)); - margin-right: calc(4 * var(--unit)); - margin-bottom: calc(-3 * var(--unit)); - background-image: url('./images/gamepage/icon_mini_money.svg'); - background-size: cover; - background-position: center; - }*/ + .PlayerInfo .withBalls::before { + left: 1rem; + } - .PlayerInfo .TotalMoney { - display: inline-flex; - flex-direction: row; + .PlayerInfo .withBalls::after { + right: 1rem; + } + + .PlayerInfo .money, .PlayerInfo .TotalMoney { + display: flex; + align-items: center; width: calc(206 * var(--unit)); color: white; font-size: calc(20 * var(--unit)); } - .PlayerInfo .TotalMoney::before { + .PlayerInfo .money::before, .PlayerInfo .TotalMoney::before { content: ""; display: inline-block; width: calc(15 * var(--unit)); height: calc(15 * var(--unit)); margin-right: calc(4 * var(--unit)); margin-bottom: calc(-3 * var(--unit)); - background-image: url('./images/gamepage/icon_mini_home.svg'); background-size: cover; background-position: center; } + .PlayerInfo .money::before { + background-image: url('./images/gamepage/icon_mini_money.svg'); + } + + .PlayerInfo .TotalMoney::before { + background-image: url('./images/gamepage/icon_mini_home.svg'); + } + .PlayerInfo .MortgageList { -/* position: absolute;*/ - top: calc(121 * var(--unit)); - left: calc(25 * var(--unit)); color: #D8C292; font-size: 20px; } + + .PlayerInfo .collapseBtn { + color: white; + cursor: pointer; + text-align: center; + font-size: 1.25rem; + user-select: none; + } + + .PlayerInfo .collapseBtn:hover { + text-decoration: underline; + } + + .PlayerInfo .MortgageList.collapseHide { + opacity: 0; + height: 0; + overflow: hidden; + pointer-events: none; + } \ No newline at end of file diff --git a/Client/Pages/Gaming/Components/PlayerRankList.razor b/Client/Pages/Gaming/Components/PlayerRankList.razor index 2b504a4..adc83c4 100644 --- a/Client/Pages/Gaming/Components/PlayerRankList.razor +++ b/Client/Pages/Gaming/Components/PlayerRankList.razor @@ -2,15 +2,20 @@
-
- 1 +
+ 1 +
+

+ Jason1 +

-
- Jason1 +
+
+
+

1,0000

+

9,000

+
-
1,0000
-
9,000
-
@@ -18,15 +23,20 @@
-
- 2 +
+ 2 +
+

+ Jason2 +

-
- Jason2 +
+
+
+

1,0000

+

9,000

+
-
1,0000
-
9,000
-
@@ -34,15 +44,20 @@
-
- 3 +
+ 3 +
+

+ Jason3 +

-
- Jason3 +
+
+
+

1,0000

+

9,000

+
-
1,0000
-
9,000
-
@@ -50,15 +65,20 @@
-
- 4 +
+ 4 +
+

+ Jason4 +

-
- Jason4 +
+
+
+

1,0000

+

9,000

+
-
1,0000
-
9,000
-
diff --git a/Client/Pages/Gaming/Components/PlayerRankList.razor.css b/Client/Pages/Gaming/Components/PlayerRankList.razor.css index e9a57c8..6c46871 100644 --- a/Client/Pages/Gaming/Components/PlayerRankList.razor.css +++ b/Client/Pages/Gaming/Components/PlayerRankList.razor.css @@ -10,76 +10,80 @@ .PlayerRankList .PlayerInfo { position: relative; width: calc(178 * var(--unit)); - height: calc(90 * var(--unit)); + height: fit-content; border-radius: calc(20 * var(--unit)); /* 方框圓角半徑 */ border: calc(4 * var(--unit)) solid #008227; /* 方框邊框寬度和顏色 */ background-color: #5B5B5B; /* 底色 */ + padding: 1rem; + margin-bottom: 8px; } + .PlayerRankList .PlayerInfo .Rank { - position: absolute; - top: 0; - left: 0; + display: flex; + align-items: center; + gap: .5rem; + margin-bottom: .5rem; } + .PlayerRankList .PlayerInfo .Rank .Round { - position: absolute; - width: calc(24 * var(--unit)); - height: calc(24 * var(--unit)); - top: 0; - left: 0; + display: flex; + justify-content: center; + align-items: center; + width: 24px; + height: 24px; border-radius: 50%; /* 圓形 */ border: calc(1 * var(--unit)) solid white; /* 外框 */ background-color: #D8C292; /* 底色 */ } - .PlayerRankList .PlayerInfo .Rank .Number { - position: absolute; - top: calc(5.5 * var(--unit)); - left: calc(9 * var(--unit)); - color: #5B5B5B; - font-size: calc(16 * var(--unit)); - text-align: center; - } - .PlayerRankList .PlayerInfo .Name { - position: relative; - width: calc(40 * var(--unit)); - height: calc(21 * var(--unit)); - top: 0; - left: calc(31 * var(--unit)); - color: white; - font-size: calc(20 * var(--unit)); - } + .PlayerRankList .PlayerInfo .Rank .Round .Number { + color: #5B5B5B; + } - .PlayerRankList .PlayerInfo .Icon { - position: absolute; - width: calc(60 * var(--unit)); - height: calc(50 * var(--unit)); - top: calc(25 * var(--unit)); - left: calc(16 * var(--unit)); - /*background-image: url('./images/roles/avatars/小美頭.svg');*/ - background-size: cover; - background-position: center; - } - .PlayerRankList .PlayerInfo .Icon.baby { - background-image: url('images/roles/avatars/老人頭.svg'); - } - .PlayerRankList .PlayerInfo .Icon.oldman { - background-image: url('images/roles/avatars/寶寶頭.svg'); - } - .PlayerRankList .PlayerInfo .Icon.dai { - background-image: url('images/roles/avatars/阿呆頭.svg'); - } - .PlayerRankList .PlayerInfo .Icon.mei { - background-image: url('images/roles/avatars/小美頭.svg'); + .PlayerRankList .PlayerInfo .Name { + width: calc(40 * var(--unit)); + color: white; + font-size: calc(20 * var(--unit)); + margin: 0; + } + + .PlayerRankList .PlayerInfo .PlayerMoney { + display: flex; + align-items: center; + gap: .5rem; + } + + .PlayerRankList .PlayerInfo .Icon { + width: calc(60 * var(--unit)); + height: calc(50 * var(--unit)); + /*background-image: url('./images/roles/avatars/小美頭.svg');*/ + background-size: cover; + background-position: center; + } + + .PlayerRankList .PlayerInfo .Icon.baby { + background-image: url('images/roles/avatars/寶寶頭.svg'); + } + + .PlayerRankList .PlayerInfo .Icon.oldman { + background-image: url('images/roles/avatars/老人頭.svg'); + } + + .PlayerRankList .PlayerInfo .Icon.dai { + background-image: url('images/roles/avatars/阿呆頭.svg'); + } + + .PlayerRankList .PlayerInfo .Icon.mei { + background-image: url('images/roles/avatars/小美頭.svg'); + } + + .PlayerRankList .PlayerInfo .Money { + width: calc(94 * var(--unit)); + color: white; + font-size: calc(20 * var(--unit)); + margin: 0; } - .PlayerRankList .PlayerInfo .Money { - position: absolute; - width: calc(94 * var(--unit)); - top: calc(30 * var(--unit)); - left: calc(84 * var(--unit)); - color: white; - font-size: calc(20 * var(--unit)); - } .PlayerRankList .PlayerInfo .Money::before { content: ""; display: inline-block; @@ -92,14 +96,13 @@ background-position: center; } - .PlayerRankList .PlayerInfo .TotalMoney { - position: absolute; - width: calc(94 * var(--unit)); - top: calc(54 * var(--unit)); - left: calc(84 * var(--unit)); - color: white; - font-size: calc(20 * var(--unit)); - } + .PlayerRankList .PlayerInfo .TotalMoney { + width: calc(94 * var(--unit)); + color: white; + font-size: calc(20 * var(--unit)); + margin: 0; + } + .PlayerRankList .PlayerInfo .TotalMoney::before { content: ""; display: inline-block; From a9953a8e156d3d57f85f1aa5da2d91876d877f34 Mon Sep 17 00:00:00 2001 From: Brad Date: Thu, 30 May 2024 21:14:27 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=AE=93=E7=95=AB=E9=9D=A2=E5=85=83?= =?UTF-8?q?=E4=BB=B6=E4=BE=9D=E7=85=A7=E8=B3=87=E6=96=99=E9=80=B2=E8=A1=8C?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{Ready/Entities => Enums}/ColorEnum.cs | 2 +- Client/Pages/Enums/GamingStatusEnum.cs | 6 + .../{Ready/Entities => Enums}/RoleEnum.cs | 2 +- .../Pages/Gaming/Components/PlayerInfo.razor | 15 ++- .../Gaming/Components/PlayerRankList.razor | 115 +++++------------- Client/Pages/Gaming/Entities/ILandContract.cs | 9 ++ Client/Pages/Gaming/Entities/Player.cs | 19 +++ Client/Pages/Gaming/GamingPage.razor | 16 +-- Client/Pages/Gaming/GamingPage.razor.cs | 52 +++++++- .../Ready/Components/ColorChoicePanel.razor | 2 +- .../Components/ColorChoicePanel.razor.cs | 3 +- .../Ready/Components/ReadyButton.razor.cs | 3 +- .../Ready/Components/RoleChoicePanel.razor | 2 +- .../Ready/Components/RoleChoicePanel.razor.cs | 3 +- Client/Pages/Ready/Entities/Player.cs | 4 +- 15 files changed, 147 insertions(+), 106 deletions(-) rename Client/Pages/{Ready/Entities => Enums}/ColorEnum.cs (65%) create mode 100644 Client/Pages/Enums/GamingStatusEnum.cs rename Client/Pages/{Ready/Entities => Enums}/RoleEnum.cs (64%) create mode 100644 Client/Pages/Gaming/Entities/ILandContract.cs create mode 100644 Client/Pages/Gaming/Entities/Player.cs diff --git a/Client/Pages/Ready/Entities/ColorEnum.cs b/Client/Pages/Enums/ColorEnum.cs similarity index 65% rename from Client/Pages/Ready/Entities/ColorEnum.cs rename to Client/Pages/Enums/ColorEnum.cs index 6499621..ff92b90 100644 --- a/Client/Pages/Ready/Entities/ColorEnum.cs +++ b/Client/Pages/Enums/ColorEnum.cs @@ -1,4 +1,4 @@ -namespace Client.Pages.Ready.Entities; +namespace Client.Pages.Enums; public enum ColorEnum { diff --git a/Client/Pages/Enums/GamingStatusEnum.cs b/Client/Pages/Enums/GamingStatusEnum.cs new file mode 100644 index 0000000..e9c82f3 --- /dev/null +++ b/Client/Pages/Enums/GamingStatusEnum.cs @@ -0,0 +1,6 @@ +namespace Client.Pages.Enums; + +public enum GamingStatusEnum +{ + None, +} diff --git a/Client/Pages/Ready/Entities/RoleEnum.cs b/Client/Pages/Enums/RoleEnum.cs similarity index 64% rename from Client/Pages/Ready/Entities/RoleEnum.cs rename to Client/Pages/Enums/RoleEnum.cs index 6ac7611..4792895 100644 --- a/Client/Pages/Ready/Entities/RoleEnum.cs +++ b/Client/Pages/Enums/RoleEnum.cs @@ -1,4 +1,4 @@ -namespace Client.Pages.Ready.Entities; +namespace Client.Pages.Enums; public enum RoleEnum { diff --git a/Client/Pages/Gaming/Components/PlayerInfo.razor b/Client/Pages/Gaming/Components/PlayerInfo.razor index fdbcc67..c1cd989 100644 --- a/Client/Pages/Gaming/Components/PlayerInfo.razor +++ b/Client/Pages/Gaming/Components/PlayerInfo.razor @@ -1,12 +1,15 @@ - +@using Client.Pages.Gaming.Entities +@code { + [CascadingParameter] + public GamingPage Parent { get; set; } = default!; + private Player player => Parent?.Players.FirstOrDefault(); +} +
- 9,000 + @player.Money
- 9,000 -
-
- 9,000 + @player.GetTotalMoney

diff --git a/Client/Pages/Gaming/Components/PlayerRankList.razor b/Client/Pages/Gaming/Components/PlayerRankList.razor index adc83c4..40eaa9a 100644 --- a/Client/Pages/Gaming/Components/PlayerRankList.razor +++ b/Client/Pages/Gaming/Components/PlayerRankList.razor @@ -1,86 +1,33 @@ -
-
-
-
-
- 1 -
-

- Jason1 -

-
-
-
-
-

1,0000

-

9,000

-
-
-
-
-
-
-
-
-
-
- 2 -
-

- Jason2 -

-
-
-
-
-

1,0000

-

9,000

-
-
-
-
-
-
-
-
-
-
- 3 -
-

- Jason3 -

-
-
-
-
-

1,0000

-

9,000

-
-
-
-
-
-
-
-
-
-
- 4 -
-

- Jason4 -

-
-
-
-
-

1,0000

-

9,000

-
-
-
+@using Client.Pages.Gaming.Entities +@code { + [CascadingParameter] + public GamingPage Parent { get; set; } = default!; + private IEnumerable players => Parent?.Players; +} + +
+ @foreach (var (player, index) in players.OrderBy(p=>p.GetTotalMoney).Select((item, index) => (item, index))) + { +
+
+
+
+ @(@index + 1) +
+

+ @player.Name +

+
+
+
+
+

@player.Money

+

@player.GetTotalMoney

+
+
+
+
+
-
-
+ }
\ No newline at end of file diff --git a/Client/Pages/Gaming/Entities/ILandContract.cs b/Client/Pages/Gaming/Entities/ILandContract.cs new file mode 100644 index 0000000..950518d --- /dev/null +++ b/Client/Pages/Gaming/Entities/ILandContract.cs @@ -0,0 +1,9 @@ +namespace Client.Pages.Gaming.Entities; + +public interface ILandContract +{ + int Money { get; set; } + int HouseCount { get; set; } + + int HouseMoney => HouseCount * 50; //TODO +} diff --git a/Client/Pages/Gaming/Entities/Player.cs b/Client/Pages/Gaming/Entities/Player.cs new file mode 100644 index 0000000..e2c065e --- /dev/null +++ b/Client/Pages/Gaming/Entities/Player.cs @@ -0,0 +1,19 @@ +using Client.Pages.Enums; + +namespace Client.Pages.Gaming.Entities; + +public class Player +{ + public string Id { get; set; } = string.Empty; + public string Name { get; set; } = string.Empty; + public bool IsHost { get; set; } = false; + public ColorEnum Color { get; set; } = ColorEnum.None; + public RoleEnum Role { get; set; } = RoleEnum.None; + public int Order { get; set; } = 0; + + public int Money { get; set; } = 0; + public IEnumerable LandContracts { get; set; } = []; + public GamingStatusEnum Status { get; set; } = GamingStatusEnum.None; + + public int GetTotalMoney => Money + LandContracts.Sum(x => x.Money + x.HouseMoney); +} diff --git a/Client/Pages/Gaming/GamingPage.razor b/Client/Pages/Gaming/GamingPage.razor index 1f18133..94ddb59 100644 --- a/Client/Pages/Gaming/GamingPage.razor +++ b/Client/Pages/Gaming/GamingPage.razor @@ -2,13 +2,15 @@ @using Client.Pages.Gaming.Components
- + + - - - + + + - - - + + + +
\ No newline at end of file diff --git a/Client/Pages/Gaming/GamingPage.razor.cs b/Client/Pages/Gaming/GamingPage.razor.cs index 4fb7b2d..f3e27ec 100644 --- a/Client/Pages/Gaming/GamingPage.razor.cs +++ b/Client/Pages/Gaming/GamingPage.razor.cs @@ -1,5 +1,55 @@ -namespace Client.Pages.Gaming; +using Client.Pages.Enums; +using Client.Pages.Gaming.Entities; + +namespace Client.Pages.Gaming; public partial class GamingPage { + public IEnumerable Players { get; set; } = []; + + + protected override async Task OnInitializedAsync() + { + //假資料 + Players = + [ + new Player + { + Name = "Player1", + Money = 1000, + Color = ColorEnum.Red, + Role = RoleEnum.Baby, + Order = 1, + + IsHost = true + }, + new Player + { + Name = "Player2", + Money = 1000, + Color = ColorEnum.Blue, + Role = RoleEnum.Dai, + Order = 2 + }, + new Player + { + Name = "Player3", + Money = 1000, + Color = ColorEnum.Green, + Role = RoleEnum.Mei, + Order = 3 + }, + new Player + { + Name = "Player4", + Money = 1000, + Color = ColorEnum.Yellow, + Role = RoleEnum.OldMan, + Order = 4 + } + ]; + + //初始化遊戲介面,從Ready轉入Player資料 + + } } diff --git a/Client/Pages/Ready/Components/ColorChoicePanel.razor b/Client/Pages/Ready/Components/ColorChoicePanel.razor index 59595c0..c83d057 100644 --- a/Client/Pages/Ready/Components/ColorChoicePanel.razor +++ b/Client/Pages/Ready/Components/ColorChoicePanel.razor @@ -1,4 +1,4 @@ -@using Client.Pages.Ready.Entities +@using Client.Pages.Enums
@foreach (var color in new[] { ColorEnum.Blue, ColorEnum.Red, ColorEnum.Yellow, ColorEnum.Green }) { diff --git a/Client/Pages/Ready/Components/ColorChoicePanel.razor.cs b/Client/Pages/Ready/Components/ColorChoicePanel.razor.cs index 745ad5a..7afe1ae 100644 --- a/Client/Pages/Ready/Components/ColorChoicePanel.razor.cs +++ b/Client/Pages/Ready/Components/ColorChoicePanel.razor.cs @@ -1,4 +1,5 @@ -using Client.Pages.Ready.Entities; +using Client.Pages.Enums; +using Client.Pages.Ready.Entities; using Microsoft.AspNetCore.Components; namespace Client.Pages.Ready.Components; diff --git a/Client/Pages/Ready/Components/ReadyButton.razor.cs b/Client/Pages/Ready/Components/ReadyButton.razor.cs index 897e2e3..e23a25a 100644 --- a/Client/Pages/Ready/Components/ReadyButton.razor.cs +++ b/Client/Pages/Ready/Components/ReadyButton.razor.cs @@ -1,4 +1,5 @@ -using Client.Pages.Ready.Entities; +using Client.Pages.Enums; +using Client.Pages.Ready.Entities; using Microsoft.AspNetCore.Components; namespace Client.Pages.Ready.Components; diff --git a/Client/Pages/Ready/Components/RoleChoicePanel.razor b/Client/Pages/Ready/Components/RoleChoicePanel.razor index 95f40e6..bd4cdb5 100644 --- a/Client/Pages/Ready/Components/RoleChoicePanel.razor +++ b/Client/Pages/Ready/Components/RoleChoicePanel.razor @@ -1,4 +1,4 @@ -@using Client.Pages.Ready.Entities +@using Client.Pages.Enums @if (CurrentPlayer is not null) {
diff --git a/Client/Pages/Ready/Components/RoleChoicePanel.razor.cs b/Client/Pages/Ready/Components/RoleChoicePanel.razor.cs index 2c25969..f9618a9 100644 --- a/Client/Pages/Ready/Components/RoleChoicePanel.razor.cs +++ b/Client/Pages/Ready/Components/RoleChoicePanel.razor.cs @@ -1,4 +1,5 @@ -using Client.Pages.Ready.Entities; +using Client.Pages.Enums; +using Client.Pages.Ready.Entities; using Microsoft.AspNetCore.Components; namespace Client.Pages.Ready.Components; diff --git a/Client/Pages/Ready/Entities/Player.cs b/Client/Pages/Ready/Entities/Player.cs index 6fe3075..72f8004 100644 --- a/Client/Pages/Ready/Entities/Player.cs +++ b/Client/Pages/Ready/Entities/Player.cs @@ -1,4 +1,6 @@ -namespace Client.Pages.Ready.Entities; +using Client.Pages.Enums; + +namespace Client.Pages.Ready.Entities; public class Player { From 4fd0ec158c9541785747e8cbbce935421ec5bf24 Mon Sep 17 00:00:00 2001 From: Brad Date: Thu, 30 May 2024 21:15:54 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=9B=9E=E5=BE=A9=E8=B5=B7=E5=A7=8B?= =?UTF-8?q?=E9=A0=81=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Client/Properties/launchSettings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Client/Properties/launchSettings.json b/Client/Properties/launchSettings.json index d274eed..15350af 100644 --- a/Client/Properties/launchSettings.json +++ b/Client/Properties/launchSettings.json @@ -11,7 +11,7 @@ "dotnetRunMessages": true, "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", - "applicationUrl": "http://localhost:5184/GamingPage", + "applicationUrl": "http://localhost:5184/dev-page", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } @@ -22,7 +22,7 @@ "launchBrowser": true, "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", "applicationUrl": "https://localhost:7047;http://localhost:5184", - "launchUrl": "https://localhost:7047/GamingPage", + "launchUrl": "https://localhost:7047/dev-page", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }