public Galaxy(GalaxyShape shape, Shuffle shuffle, int rad = 3, int players = 6)
 {
     if (shape == GalaxyShape.Standard)
     {
         init(rad);
         GenerateStandard(shuffle, rad, players);
     }
 }
 public Galaxy(GalaxyShape shape, int rad = 3, int playerCount = 6, Shuffle shuffle = null)
 {
     init(rad, playerCount);
     if (shape == GalaxyShape.Standard)
     {
         GenerateStandard(rad, playerCount, shuffle);
     }
 }
Beispiel #3
0
        public Galaxy Galaxy_Create(String name, GalaxyShape shape, Boolean active)
        {
            using (var cmd = this.GetCommand())
            {
                Int32 id = 0;

                cmd.CommandType = System.Data.CommandType.StoredProcedure;
                cmd.CommandText = "[dbo].[Galaxy_ByPublicId]";
                cmd.Parameters.AddWithValue("@name", name);
                cmd.Parameters.AddWithValue("@shape", shape.ToString());
                cmd.Parameters.AddWithValue("@active", active);
                SqlParameter param = new SqlParameter("@id", id);
                param.Direction = ParameterDirection.Output;
                cmd.Parameters.Add(param);

                cmd.ExecuteNonQuery();

                id = Convert.ToInt32( param.Value );

                return new Galaxy();

            }
        }