Seed









How do I use Seed
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: INetworkService.cs Copy
14         Signal OnRemoteBoardChangeSignal { get; }
File name: NetworkAdapter.cs Copy
21         public Signal OnRemoteBoardChangeSignal { get; private set; }
File name: NetworkAdapter.cs Copy
130         public void SendBoardChange(Seed seed, int row, int col)
131         {
132             if (PhotonNetwork.room != null && PhotonNetwork.room.playerCount == 2)
133             {
134                 photonView.RPC("OnRemoteBoardChange", PhotonTargets.OthersBuffered, (int)seed, row, col);
135             }
136         }
File name: NetworkAdapter.cs Copy
138         private void Awake()
139         {
140             OnBeginConnectingSignal = new Signal();
141             OnConnectedToMasterSignal = new Signal();
142             OnDisconnectedFromMasterSignal = new Signal();
143             OnConnectionFailSignal = new Signal();
144             OnJoinedRoomSignal = new Signal();
145             OnAllPlayersConnectedSignal = new Signal();
146             OnRemoteBoardChangeSignal = new Signal();
147             OnNewGameStartedSignal = new Signal();
148
149             ServiceLocator.AddService(this);
150         }
File name: NetworkAdapter.cs Copy
208         private void OnRemoteBoardChange(int seed, int row, int col)
209         {
210             OnRemoteBoardChangeSignal.Dispatch((Seed)seed, row, col);
211         }
File name: Board.cs Copy
22         public void Init(Action onBoardChangeAction)
23         {
24             CreateCells();
25             SetPlayer(Seed.Empty);
26             onBoardChange = onBoardChangeAction;
27         }
File name: Board.cs Copy
29         public void SetPlayer(Seed seed)
30         {
31             currentPlayer = seed;
32         }
File name: Board.cs Copy
34         public void SetCell(Seed seed, int row, int col)
35         {
36             SetPlayer(seed);
37             OnCellClick(cells[row, col]);
38         }
File name: Board.cs Copy
53         public bool IsDraw()
54         {
55             for (int row = 0; row < ROWS; row++)
56             {
57                 for (int col = 0; col < COLS; col++)
58                 {
59                     if (cells[row, col].Content == Seed.Empty)
60                     {
61                         return false;
62                     }
63                 }
64             }
65
66             return true;
67         }
File name: Board.cs Copy
69         public bool HasWon(Seed seed)
70         {
71             if (lastChangedCell == null)
72             {
73                 return false;
74             }
75
76             return HasWonInTheRow(seed)
77                 || HasWonInTheColumn(seed)
78                 || HasWonInTheDiagonal(seed)
79                 || HasWonInTheOppositeDiagonal(seed);
80         }

Download file with original file name:Seed

Seed 125 lượt xem

Gõ tìm kiếm nhanh...