ºÇ½ª¹¹¿·¡§
orika_ex_miyako 2022ǯ03·î07Æü(·î) 16:21:04ÍúÎò
¡¡Grid ¤ò¥¯¥ê¥Ã¥¯¤·¤¿ºÝ¤Ë¡¢¡û¡ß¤Î°õ¤¬¤Ä¤¤¤Æ¤¤¤ë¤«¤É¤¦¤«¤òȽÄꤷ¡¢¤É¤Á¤é¤Î°õ¤â¤Ê¤¤¾ì¹ç¤Ë¤Ï¡»°õ¤ò¤Ä¤±¤ë¤³¤È¤¬¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
¤³¤Î¼ê½ç¤Ç¤Ï¡¢°õ¤ò¤Ä¤±¤¿¤¢¤È¤Ë£³¤Ä¡»°õ¤¬¤Ä¤¤¤Æ¤¤¤ë¤«¤É¤¦¤«¤òȽÄꤷ¡¢¾¡ÇÔ¤ò·èÄꤹ¤ëµ¡Ç½¤òÀ߷פ·¤Æ¤¤¤¤Þ¤¹¡£
¤³¤Î¾¡ÇÔ¤ÎȽÄê½èÍý¤¬Èó¾ï¤ËÆñ¤·¤¤¤È´¶¤¸¤ë¤«¤È»×¤¤¤Þ¤¹¤Î¤Ç¡¢¤¸¤Ã¤¯¤ê¤È¹Í¤¨¤Æ¼ÂÁõ¤ËÄ©À路¤Æ¤¯¤À¤µ¤¤¡£¡£
¡¡¾¡Íø¾ò·ï¤òËþ¤¿¤·¤¿¾ì¹ç¤Ë¤Ï¡¢Debug.Log ¥á¥½¥Ã¥É¤Ë¤è¤ê¡¢Console ¥Ó¥å¡¼¤Ëɽ¼¨¤ò¹Ô¤Ã¤Æ¡¢½èÍý¤¬Àµ¾ï¤ËÆ°ºî¤·¤Æ¤¤¤ë¤«¤òȽÄꤵ¤»¤Þ¤¹¡£
¡ã¼ÂÁõÆ°²è¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¡¡°Ê²¼¤ÎÆâÍƤǽçÈ֤˼ÂÁõ¤ò¿Ê¤á¤Æ¤¤¤¤Þ¤¹¡£
¼ê½ç£¸¡¡¡¼¾¡ÇÔȽÄ굡ǽ¤ò¼ÂÁõ¤¹¤ë¡¼
£±£´¡¥GameManager ¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¡¢¡»¤«¡ß¤Î¤¤¤º¤ì¤«¤¬½Ä¡¦²£¡¦¼Ð¤á¤Î£³¤Ä¤Î¥Þ¥¹¤Ç¤Ä¤Ê¤¬¤Ã¤Æ¤¤¤ë¤«¤òȽÄꤹ¤ëµ¡Ç½¤ò¼ÂÁõ¤¹¤ë
¡¡¿·¤·¤¤³Ø½¬ÆâÍƤϡ¢°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£
¡¡¡¦½èÍý¤Î¥¢¥ë¥´¥ê¥º¥à¤ò¹Í¤¨¤ë ¡¡¡¦int ·¿¤ÎÃͤò»ØÄꤷ¤¿ enum ¤ÎÎóµó»Ò¤Î¥¥ã¥¹¥È¤¹¤ëÊýË¡
£±£´¡¥GameManager ¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¡¢¡»¤«¡ß¤Î¤¤¤º¤ì¤«¤¬½Ä¡¦²£¡¦¼Ð¤á¤Î£³¤Ä¤Î¥Þ¥¹¤Ç¤Ä¤Ê¤¬¤Ã¤Æ¤¤¤ë¤«¤òȽÄꤹ¤ëµ¡Ç½¤ò¼ÂÁõ¤¹¤ë 
¡¡¡»°õ¡¢¤¢¤ë¤¤¤Ï¡ß°õ¤¬£³¤Ä·Ò¤¬¤Ã¤Æ¤¤¤ë¾ì½ê¤¬¤¢¤ë¤«¤ò³Îǧ¤¹¤ë¾¡ÇÔȽÄê½èÍý¤ò¼ÂÁõ¤·¤Þ¤¹¡£
¡¡ÌäÂê¤Ï¡¢¤É¤Î¤è¤¦¤Ë¥Þ¥¹ÌܤΡ»°õ¤¬£³¤Ä·Ò¤¬¤Ã¤Æ¤¤¤ë¤«¤òȽÄꤹ¤ë¤«¡¢¤Ç¤¹¡£
¡¡¤Þ¤º¡¢½ÄÊý¸þ¡¦²£Êý¸þ¡¦¼Ð¤áÊý¸þ¤È¡¢°õ¤ò³Îǧ¤¹¤Ù¤Êý¸þ¤¬£³¼ïÎढ¤ê¤Þ¤¹¤Î¤Ç¡¢¤³¤Á¤é¤ò¤É¤Î¤è¤¦¤Ë¤·¤ÆȽÄꤷ¤Æ¤¤¤¯¤«¤ò·è¤á¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
¡¡
¡¡º£²ó¤Î¥²¡¼¥à¤Ç¤Ï¥Þ¥¹ÌÜ¤Ï Grid ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ò£¹¸ÄÍøÍѤ·¤ÆºîÀ®¤·¤Æ¤ª¤ê¡¢¤«¤Ä¡¢¤³¤Î Grid ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤Ï
GridController ¥¹¥¯¥ê¥×¥È¤¬¤½¤ì¤¾¤ì¤Ë¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤Æ¡¢¥Þ¥¹ÌܤÎÈÖ¹æ¤ò´ÉÍý¤·¤Æ¤¤¤ë¾õÂ֤ˤʤäƤ¤¤Þ¤¹¡£
¥²¡¼¥à²èÌÌ

¥²¡¼¥àÆâ¤Î Grid ¤ÎÈÖ¹æ
£° | £± | £² |
£³ | £´ | £µ |
£¶ | £· | £¸ |
¡¡¤³¤Î¾ðÊó¤ò³èÍѤ·¤Æ¤¤¤¡¢½ÄÊý¸þ¤È²£Êý¸þ¤È¼Ð¤áÊý¸þ¤Ë¤Ä¤¤¤Æ¡¢¥Þ¥¹ÌܤÎÈÖ¹æ¤ò»ØÄꤷ¤Æ¡¢È½Äê¤ò¹Ô¤¦À߷פˤ·¤Þ¤¹¡£
¡¡Î㤨¤Ð¡¢²£Êý¸þ¤Ç¤¢¤ì¤Ð¡¢£°¡¢£±¡¢£² ¤Î¥Þ¥¹¡¢£³¡¢£´¡¢£µ¤Î¥Þ¥¹¡¢£¶¡¢£·¡¢£¸¤Î¥Þ¥¹¤Î£³¤Ä¤Î¥Ñ¥¿¡¼¥ó¤òȽÄꤷ¤Þ¤¹¡£
¤³¤Á¤é¤Ë¤Ä¤¤¤Æ¤Ï¡¢¤³¤Î¥Ñ¥¿¡¼¥óÄ̤ê¤Ë£³¤Ä¤Î¾ðÊó¤ò if ʸ¤Î¾ò·ï¼°¤È¤·¤Æ¤â¤è¤¤¤Ç¤¹¤¬¡¢Èó¾ï¤ËŤ¤½èÍý¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹¤Î¤Ç¡¢
£³¤Ä¤Î¥Ñ¥¿¡¼¥ó¤Ë¤Ê¤Ã¤Æ¤¤¤ë¿ô»ú¤ò²òÀϤ·¤Æ¥¢¥ë¥´¥ê¥º¥à(·×»»ÊýË¡)¤ò¹Í¤¨¤Æ¤ß¤Þ¤¹¡£
¡¡²£Êý¸þ¤Ç¤¢¤ì¤Ð¡¢£±¤Ä¤Î¹Ô¤ò£³²ó·«¤êÊÖ¤¹¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¤Î¤Ç¡¢¤³¤¦¤¤¤Ã¤¿¥±¡¼¥¹¤Ë¤Ï£³¤Ä¤Î¿ô»ú¥Ñ¥¿¡¼¥ó¤ò¸¡¾Ú¤·¡¢
·«¤êÊÖ¤·¤Î½èÍý¤ò¾å¼ê¤¯³èÍѤ·¤Æ(for ʸ¤ÈÇÛÎó¤ÎÁȤ߹ç¤ï¤»)¥í¥¸¥Ã¥¯¤ò¹Í¤¨¤Æ¥¢¥ë¥´¥ê¥º¥à¤òºî¤ë¤³¤È¤¬½èÍý¤Î¸úΨ²½¤Ë¤Ä¤Ê¤¬¤ê¤Þ¤¹¡£
¡¡·«¤êÊÖ¤·¤Î½èÍý¤ËÇÛÎó¤òÁȤ߹ç¤ï¤»¤ÆÍøÍѤ¹¤ëÍýͳ¤Ï¡¢¥Þ¥¹ÌܤξðÊó¤ò GridController ¥¹¥¯¥ê¥×¥È¤¬´ÉÍý¤·¤Æ¤ª¤ê(¥Þ¥¹ÌܤÎÈÖ¹æ¤ä¥ª¡¼¥Ê¡¼¥·¥ó¥Ü¥ë¤Î¾ðÊó)¡¢
¤½¤ì¤ò´ÉÍý¤·¤Æ¤¤¤ë¤Î¤¬¡¢grids ÇÛÎó¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤¿¤á¤Ç¤¹¡£
ÇÛÎó¤ÎÍ×ÁÇÈÖ¹æ¤Î»ØÄêÉôʬ¤òÊÑ¿ô¤Ë¤·¤Æ¡¢n ÈÖÌܤÎÇÛÎó¤ÎÍ×ÁÇ = GridController ¤Î¾ðÊó¤ò»²¾È¤¹¤ë¤è¤¦¤ËÀ߷פ·¤Þ¤¹¡£
¡¡²£Êý¸þ¤Ë¤Ä¤¤¤Æ£±¤Ä¤Î¹Ô¤´¤È¤ËȽÄꤷ¤¿¤¤¥Þ¥¹ÌܤÎÈÖ¹æ¤ò¤ß¤Æ¤ß¤ë¤È¡¢Á°¤Î¹Ô¤ÎÃͤò£³¤º¤ÄÁý¤ä¤·¤Æ¤¤¤±¤Ð¡¢
¼¡¤Î¹Ô¤ÎÃͤȤ·¤ÆÍøÍѤǤ¤ë¥Ñ¥¿¡¼¥ó¤¬É⤫¤Ó¤¢¤¬¤Ã¤Æ¤¤Þ¤¹¡£
¤½¤·¤Æ¤½¤ì¤ò¼ÂºÝ¤Ë for ʸ¤ÈÇÛÎó¤ò»È¤Ã¤Æ¥í¥¸¥Ã¥¯²½¤¹¤ë¤È¡¢¼¡¤Î¤è¤¦¤Ê¼°¤¬ºîÀ®¤Ç¤¤Þ¤¹¡£
¡¡
¡ãfor ʸ¤ÈÇÛÎó¤ò»È¤Ã¤¿²£Êý¸þ¤ÎȽÄê½èÍý¤Î¥¢¥ë¥´¥ê¥º¥à¡ä
¡¡// ²£Êý¸þ // 0,1,2 || 3,4,5 || 6,7,8 ¤Î¥Þ¥¹¤ò³Îǧ¤¹¤ë for (int x = 0; x < 3; x++) { if (grids[x * 3] // º¸¤Î¥Þ¥¹¤ÎȽÄêÃÍ x * 3 ¤Î·ë²Ì¤Ê¤Î¤Ç¡¢grids[0(0 * 3)] / grids[3(1 * 3)] / grids [6(2 * 3)] ¤È¤Ê¤ë && grids[x * 3 + 1] // ¿¿¤óÃæ¤Î¥Þ¥¹¤ÎȽÄêÃÍ¡¡x * 3 + 1¤Î·ë²Ì¤Ê¤Î¤Ç¡¢grids[1(0 * 3 + 1)] / grids[4(1 * 3 + 1)] / grids [7(2 * 3 + 1)] ¤È¤Ê¤ë && grids[x * 3 + 2]) // ±¦¤Î¥Þ¥¹¤ÎȽÄêÃÍ x * 3 +2 ¤Î·ë²Ì¤Ê¤Î¤Ç¡¢grids[2(0 * 3 + 2)] / grids[5(1 * 3 + 2)] / grids [8(2 * 3 + 2)] ¤È¤Ê¤ë { // ¾åµ¤Î¾ò·ï¤ò¤¹¤Ù¤ÆËþ¤¿¤»¤Ð¡¢£³¤Ä¤½¤í¤Ã¤Æ¤¤¤ë¤Î¤Ç¾¡¤Á¤Ë¤Ê¤ë }
¡¡for ʸ¤¬¥ë¡¼¥×¤¹¤ë¤¿¤Ó¤Ë x ¤ÎÃͤ¬²Ã»»¤µ¤ì¤ë¤¿¤á¡¢¤³¤Î¥í¥¸¥Ã¥¯¤ò»È¤¦¤³¤È¤Ë¤è¤ê¡¢²£Êý¸þ¤Î£³¥Ñ¥¿¡¼¥ó¤Ë¤Ä¤¤¤Æ¤Ï¡¢¤¹¤Ù¤Æ³Îǧ¤ò¹Ô¤¦¤³¤È¤¬²Äǽ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
if ʸÆâ¤Î¾ò·ï¼°¤¬ && ¤Ç¤Ä¤Ê¤¬¤Ã¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢£³¤Ä¤Î¾ò·ï¤ò¤¹¤Ù¤ÆËþ¤¿¤·¤Æ¤¤¤ë¤«¤É¤¦¤«¤òÈæ³Óɾ²Á¤·¤Æ¤¤¤Þ¤¹¡£
¡¡Æ±¤¸Í×ÎΤǡ¢½ÄÊý¸þ¤È¼Ð¤áÊý¸þ¤Ë¤Ä¤¤¤Æ¤â¡¢Ä´¤Ù¤¿¤¤¥Þ¥¹Ìܤò¤¹¤Ù¤Æ½ñ¤½Ð¤·¡¢¤½¤ì¤ò·«¤êÊÖ¤¹½èÍý¤ò»È¤Ã¤Æ¥¢¥ë¥´¥ê¥º¥à¤òºî¤ë¤Ë¤Ï¤É¤¦¤¹¤ì¤Ð¤¤¤¤¤Î¤«¤ò¹Í¤¨¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
¡¡¼ÂºÝ¤Î½èÍý¤Ï¡¢¾åµ¤Î for ʸ¤Ë¼ê¤ò²Ã¤¨¤Æ¡¢Grid ¤Î¥ª¡¼¥Ê¡¼¥·¥ó¥Ü¥ë¤Î¾ðÊó¤òÀººº¤·¤Þ¤¹¡£
¤½¤ÎºÝ¤â¡¢¡»¤È¡ß¤Ç½èÍý¤òʬ¤±¤Æ¤·¤Þ¤¦¤È¡¢¡»¤È¡ß°Ê³°¤ÎȽÄêÉôʬ¤Ë¤Ä¤¤¤Æ¤Ï¤¹¤Ù¤ÆƱ¤¸½èÍý¤òµ½Ò¤·¤Ê¤¤¤È¤Ê¤é¤Ê¤¯¤Ê¤ë¤¿¤á¡¢
¤³¤ÎÉôʬ¤â for ʸ¤òÍøÍѤ·¡¢£±¤Ä¤Î¥á¥½¥Ã¥ÉÆâ¤ÇξÊý¤Î½èÍý¤¬¹Ô¤¨¤ë¤è¤¦¤ÊÀ߷פˤ·¤Þ¤¹¡£
¡¡¥í¥¸¥Ã¥¯¤Ë²Ã¤¨¤Æ¡¢¥¢¥ë¥´¥ê¥º¥à¤òºî¤ë¤³¤È¤ÏÈó¾ï¤ËÆñ¤·¤¤¤Ç¤¹¤¬¡¢¥Æ¡¼¥Ö¥ë¥²¡¼¥à¤Î¿¤¯¤Ï¥¢¥ë¥´¥ê¥º¥à¤ò¹Í¤¨¤ë¤³¤È¤¬½ÅÍפʤΤǡ¢¤È¤Æ¤â¤è¤¤Æ¬¤ÎÂÎÁà¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¡¾¡ÇÔ¤¬³ÎÄꤷ¤¿¤«¤òȽÄꤹ¤ë¤¿¤á¤Îµ¡Ç½¤òͤ¹¤ë JudgeWinner ¥á¥½¥Ã¥É¤È¡¢¾¡Íø¸å¤Î½èÍý¤ò¼Â¹Ô¤¹¤ë ShowResult ¥á¥½¥Ã¥É¤òºîÀ®¤·¤Þ¤¹¡£
ShowResult ¥á¥½¥Ã¥É¤Ë¤Ä¤¤¤Æ¤Ï¡¢¼¡°Ê¹ß¤Î¼ê½ç¤Ç¼ÂÁõ¤ò¹Ô¤¦¤¿¤á¡¢TODO ¤Ç¼ÂÁõ¤·¤¿¤¤½èÍý¤ò»Ä¤·¤Æ¤ª¤¤Þ¤¹¡£
¡¡¤³¤Î JudgeWinner ¥á¥½¥Ã¥É¤Ï¡¢Àè¤Û¤ÉÀâÌÀ¤·¤¿¥¢¥ë¥´¥ê¥º¥à¤òºî¤Ã¤Æ£³¤Ä¤ÎÊý¸þ¤ÎÁ´¥Ñ¥¿¡¼¥ó¤òȽÄê¤Ç¤¤ë¤è¤¦¤Ë¥í¥¸¥Ã¥¯¤òÁȤó¤Ç¤¤¤Þ¤¹¡£
Æä˼ФáÊý¸þ¤Î¥¢¥ë¥´¥ê¥º¥à¤Ë¤Ä¤¤¤Æ¤Ï¡¢for ʸÆâ¤Î¾ò·ï½ñ¼°¤«¤é¾¤Î£²¤Ä¤È¤Ï°Û¤Ê¤ë¤¿¤á¡¢Ãí°Õ¤¬É¬ÍפǤ¹¡£
¼«Ê¬¤Ç½èÍý¤Î¥¤¥á¡¼¥¸¤ò»×¤¤É⤫¤Ù¤Ê¤¬¤é½ñ¤¯¤è¤¦¤Ë¤·¤Æ¤¤¤¯¤È¡¢¤è¤ê¿¼¤¤³Ø½¬¤Ë¤Ê¤ë¤È»×¤¤¤Þ¤¹¡£
¡¡JudgeWinner ¥á¥½¥Ã¥É¤Ï°õ¤ò¤Ä¤±¤¿½èÍý¤Î¤¢¤È¤Ë¼Â¹Ô¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢¡»°õ¤òÀßÃÖ¢ª¾¡ÇÔȽÄê¤È¤¤¤¦½èÍý¤Îή¤ì¤òºî¤ê¤Þ¤¹¡£
¤³¤ì¤Ï¡¢¥³¥ó¥Ô¥å¡¼¥¿Â¦¤âƱ¤¸½èÍý¤Îή¤ì¤Ç¼ÂÁõ¤¹¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¤Î¤Ç¡¢¤É¤Î¤è¤¦¤Ê½çÈ֤ǽèÍý¤¬Æ°¤¤¤Æ¤¤¤ë¤«¤òÇÄ°®¤·¤Æ¤ª¤¯¤³¤È¤¬ÂçÀڤǤ¹¡£
¡¡¤¤¤º¤ì¤«¤ÎÊý¸þ¤ËƱ¤¸°õ¤¬£³¤Äʤó¤Ç¤ª¤ê¡¢¾¡Íø¤¬³ÎÄꤷ¤¿¾ì¹ç¤Ë¤Ï¡¢¾¡¼Ô¤Î¾ðÊó¤ò°ú¿ô¤È¤·¤Æ ShowResult ¥á¥½¥Ã¥É¤ËÅϤ¹¤³¤È¤Ç¡¢
£±¤Ä¤Î¥á¥½¥Ã¥É¤Ç°Û¤Ê¤ë¾¡¼Ô¤Î¾ðÊó¤ËÂбþ¤Ç¤¤ë¤è¤¦¤ÊÀ߷פˤ·¤Æ¤¤¤Þ¤¹¡£
GameManager.cs
¡¡¤¶¤Ã¤È¤ß¤¿¤À¤±¤Ç¤Ï¡¢ÊÑ¿ô¥Ù¡¼¥¹¤Ç½èÍý¤¬µ½Ò¤µ¤ì¤Æ¤¤¤ë¤¿¤á¡¢¼ÂºÝ¤Ë¤É¤Î¤è¤¦¤ÊÆâÍƤˤʤäƤ¤¤ë¤Î¤«Èó¾ï¤Ë¤ï¤«¤ê¤Ë¤¯¤¤¤È»×¤¤¤Þ¤¹¡£
½èÍýÆâ¤Ë¤Ï½ñ¤¤¤Æ¤¢¤ê¤Þ¤»¤ó¤¬¡¢¼«Ê¬¤Ç Debug.Log ¥á¥½¥Ã¥É¤Ê¤É¤òÍøÍѤ·¤Æ¡¢³ÆÊÑ¿ô¤ÎÃÍ(i ¤ä x¡Ë¤òÄ´¤Ù¤Æ¤ß¤ë¤È¡¢Grid ¤Î¤É¤Î¥Þ¥¹ÌܤòÄ´¤Ù¤Æ¤¤¤ë¤Î¤«¤¬Ê¬¤«¤Ã¤Æ¤¤Þ¤¹¡£
¡¡¤Þ¤¿¤³¤Îµ½Ò¤À¤±¤¬¥¢¥ë¥´¥ê¥º¥à¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤Î¤Ç¡¢Â¾¤Ë¤â¹Í¤¨¤Æ¤ß¤ë¤È¤¤¤¤¤Ç¤·¤ç¤¦¡£
¡¡º£²ó¼ÂÁõ¤·¤¿½èÍý¤ÎÃæ¤Ë¤ª¤¤¤Æ¡¢¼ê½ç£µ¤ÇÀâÌÀ¤·¤Æ¤¤¤¿ enum ¤ÎÎóµó»Ò¤ÎÃͤò int ·¿¤Ë¥¥ã¥¹¥È(·¿ÊÑ´¹)¤¹¤ë½èÍý¤Î¡¢µÕ¥Ñ¥¿¡¼¥ó¤¬ÍøÍѤµ¤ì¤Æ¤¤¤Þ¤¹¡£
¡¡¤³¤³¤Ç¤Ï¡¢int ·¿¤ÎÃͤò enum ¤Ç¤¢¤ë GridOwnerType ·¿¤Ë¥¥ã¥¹¥È¤·¤Æ¤¤¤Þ¤¹¡£
¡ãint ·¿¤Î¾ðÊó¤ò enum(GridOwnerType) ¤ÎÎóµó»Ò¤Ë·¿ÊÑ´¹¡ä
(GridOwnerType)gridOwnerTypeNo
¡¡¤³¤Î½èÍý¤ò¹Ô¤¦¤³¤È¤Ç¡¢int ·¿¤Î gridOwnerTypeNo ÊÑ¿ô¤Î¾ðÊó¤ò GridOwnerType ¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ëÎóµó»Ò¤Ë¥¥ã¥¹¥È(·¿ÊÑ´¹)¤·¤Æ¤¤¤Þ¤¹¡£
¥¥ã¥¹¥È¤µ¤ì¤ëºÝ¤Ë¤Ï¡¢enum ¦¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë int ·¿¤Î¾ðÊó¤ò¸µ¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£Îóµó»Ò¤òÅÐÏ¿¤¹¤ëºÝ¤ËÆä˻ØÄꤷ¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢¼«Æ°Åª¤Ë 0 ¤«¤éºÎÈÖ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
¡¡¤½¤Î¤¿¤á¡¢º£²ó¤Î¥±¡¼¥¹¤Ç¤Ï¡¢¼¡¤Î¤è¤¦¤Ê¥¥ã¥¹¥È¤¬¹Ô¤ï¤ì¤Æ¤¤¤Þ¤¹¡£
¡¡gridOwnerTypeNo = 0 ¤Ê¤é¤Ð¡¢GridOwnerType ¤Î None ¡¡gridOwnerTypeNo = 1 ¤Ê¤é¤Ð¡¢GridOwnerType ¤Î Player ¡¡gridOwnerTypeNo = 2 ¤Ê¤é¤Ð¡¢GridOwnerType ¤Î Opponent ¡¡gridOwnerTypeNo = 3 ¤Ê¤é¤Ð¡¢GridOwnerType ¤Î Draw
¡¡¤½¤·¤Æ enum ¤Ë¤Ê¤Ã¤¿¾ðÊó¤òɾ²Á¤·¤Æ¤¤¤ë½èÍý¤ËÍøÍѤ·¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢Èæ³Ó½èÍý¤ò¹Ô¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
½èÍýÈ´¿è
grids[x * 3].CurrentGridOwnerType == (GridOwnerType)gridOwnerTypeNo ¡¡¡¡¡¡¢ grids[x * 3].CurrentGridOwnerType == gridOwnerTypeNo ÊÑ¿ô¤«¤é¥¥ã¥¹¥È¤µ¤ì¤¿ GridOwnerType ¤È¤·¤ÆÈæ³Ó¤·¤Æ¤¤¤ë
¡¡¥¥ã¥¹¥È¤Î½èÍý¤ò³Ð¤¨¤Æ¤ª¤¯¤³¤È¤Ç¡¢½èÍý¤Îµ½Ò¤Î¥Ð¥ê¥¨¡¼¥·¥ç¥ó¤¬¹¤¬¤ê¤Þ¤¹¡£
¡¡½èÍý¤¬´°À®¤·¤Þ¤·¤¿¤Î¤Ç¡¢ºÇ½é¤«¤éº£²ó³Ø½¬¤·¤¿ÆâÍƤò¿¶¤êÊ֤ꡢ½èÍý¤ÎÆâÍƤÎÍý²ò¤ò¿¼¤á¤Æ¤¯¤À¤µ¤¤¡£
¡¡º£²ó¤Î½èÍý¤Ï¡¢Grid ¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¡»°õ¤ò¤Ä¤±¤Æ¤¤¤¡¢¤½¤ÎÅÔÅÙ¡¢JudgeWinner ¥á¥½¥Ã¥É¤¬¼Â¹Ô¤µ¤ì¤Æ¡¢¤¹¤Ù¤Æ¤Î¥Þ¥¹Ìܤ˾¡Íø¾ò·ï¤òËþ¤¿¤·¤Æ¤¤¤ë¤«¤ÎȽÄ꤬¹Ô¤ï¤ì¤Þ¤¹¡£
¤½¤·¤Æ¡¢¤¤¤º¤ì¤«¤Î¥Þ¥¹Ìܤ¬£³¤Ä¤Ä¤Ê¤¬¤Ã¤¿»þÅÀ¤Ç ShowResult ¥á¥½¥Ã¥É¤¬¼Â¹Ô¤µ¤ì¤Æ¡¢Debug.Log ¥á¥½¥Ã¥É¤Ë¤è¤ê¡¢Console ¥Ó¥å¡¼¤Ë¾¡Íø¤·¤¿Â¦¤Î¾ðÊó¤¬É½¼¨¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
¡ã¼ÂÁõÆ°²è¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¡¡¥Ç¥Ð¥Ã¥°¤Ë¤¢¤¿¤Ã¤Æ¤Ï¡¢¤¹¤Ù¤Æ¤Î¥Ñ¥¿¡¼¥ó¤Î¾¡Íø¾ò·ï¤ò³Îǧ¤¹¤ë¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£¥Þ¥¹Ìܤò¥¯¥ê¥Ã¥¯¤¹¤ë½çÈÖ¤ÏǤ°Õ¤Ç¹½¤¤¤Þ¤»¤ó¡£
¤è¤Ã¤Æ¡¢²£Êý¸þ£³¹Ô¡¢½ÄÊý¸þ£³¹Ô¡¢¼Ð¤á£²Êý¸þ¤Î£¸²ó¤Î¥Ñ¥¿¡¼¥ó¤Î³Îǧºî¶È¤¬É¬Íפˤʤê¤Þ¤¹¡£
¡¡°Ê¾å¤Ç¤³¤Î¼ê½ç¤Ï´°À®¤Ç¤¹¡£
¡¡¼¡¤Ï¡¡¼ê½ç£¹¡¡¡Ý¥³¥ó¥Ô¥å¡¼¥¿Â¦¤Î½èÍý¤ò¼ÂÁõ¤¹¤ë¡Ý¡¡¤Ç¤¹¡£
- ¥«¥Æ¥´¥ê¡§
- ¿Ê³Ø/¥¹¥¯¡¼¥ë
- ¥×¥í¥°¥é¥ß¥ó¥°
¥³¥á¥ó¥È¤ò¤«¤¯