コード例 #1
0
 public static Lizard GetInstance()
 {
     if (lizard == null)
     {
         lizard         = new Lizard();
         lizard.Name    = "Lizard";
         lizard.LosesTo = new List <IJokenpoItem>()
         {
             Rock.GetInstance(), Scissor.GetInstance()
         };
     }
     return(lizard);
 }
コード例 #2
0
 public static Paper GetInstance()
 {
     if (paper == null)
     {
         paper         = new Paper();
         paper.Name    = "Paper";
         paper.LosesTo = new List <IJokenpoItem>()
         {
             Scissor.GetInstance(),
                 Lizard.GetInstance()
         };
     }
     return(paper);
 }
コード例 #3
0
        public static Spock GetInstance()
        {
            if (spock == null)
            {
                spock         = new Spock();
                spock.Name    = "Spock";
                spock.LosesTo = new List <IJokenpoItem> {
                    Lizard.GetInstance(),
                        Paper.GetInstance()
                };
            }

            return(spock);
        }