Esempio n. 1
0
 public void Init()
 {
     _matchRules = GetComponent <MatchRules>();
     if (PhotonNetwork.IsConnected)
     {
         foreach (var player in PhotonNetwork.PlayerList)
         {
             InstantiatePlayerLabel(player);
         }
     }
 }
Esempio n. 2
0
        public void Test_game_rule()
        {
            var homeTeam = new Movie {
                Nota = 10
            };
            var awayTeam = new Movie {
                Nota = 9
            };
            var matchRules = new MatchRules();

            var winnerTeam = matchRules.GameRule(homeTeam, awayTeam);

            winnerTeam.ShouldBe(homeTeam);
        }
Esempio n. 3
0
        public void Test_game_rule_with_tie()
        {
            var homeTeam = new Movie {
                Titulo = "A", Nota = 10
            };
            var awayTeam = new Movie {
                Titulo = "B", Nota = 10
            };
            var matchRules = new MatchRules();

            var winnerTeam = matchRules.TieBreakRule(homeTeam, awayTeam);

            winnerTeam.ShouldBe(homeTeam);
        }
Esempio n. 4
0
        public void Test_tie_break_rule()
        {
            var homeTeam = new Movie {
                Titulo = "A"
            };
            var awayTeam = new Movie {
                Titulo = "B"
            };
            var matchRules = new MatchRules();

            var winnerTeam = matchRules.TieBreakRule(homeTeam, awayTeam);

            winnerTeam.ShouldBe(homeTeam);
        }
Esempio n. 5
0
    void Awake()
    {
        if (gameState == null)
        {
            DontDestroyOnLoad(gameObject);
            gameState = this;

            // Default match rules
            matchRules = new StockRules();
        }
        else if (gameState != this)
        {
            Destroy(gameState);
        }
    }
Esempio n. 6
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("{0} {1} on {2}: translated as {3} on Round {4}, Angle={5}, Radius={6}\r\n",
                            Pivot.Type, Pivot.Price, Pivot.Date.ToString("yyyyMMdd"), Position.IndexValue, Position.Round, Position.Angle, Position.Radius);

            MatchRules      during    = new MatchRules(Pivot.Date, Ephemeris.DefaultSearchMode);
            List <Relation> relations = Ephemeris.RelationsWithin(during);

            foreach (Relation rel in relations)
            {
                if (NeglectMoon && rel.Inferior == PlanetId.SE_MOON || rel.Superior == PlanetId.SE_MOON)
                {
                    continue;
                }

                sb.AppendFormat(", {0}{1}{2}(Orb={3})",
                                Planet.SymbolOf(rel.Superior), rel.Aspect.Symbol, Planet.SymbolOf(rel.Inferior), rel.Orb.ToString("F3"));
            }

            return(sb.ToString());
        }
Esempio n. 7
0
        private static int RunTemplate(TemplateOptions options)
        {
            switch (options.Type.ToLowerInvariant())
            {
            case "definition":
                var def = new ContentDefinition();
                def.MeshConfigs.Add("yourConfigName", new MeshConfig {
                    Mesh      = "yourMeshName",
                    Materials = new List <Material> {
                        new Material {
                            Textures = new Dictionary <string, string>
                            {
                                { "yourShaderParameterName", "yourTextureName" }
                            }
                        }
                    },
                    CustomAttachPoints = new List <AttachPoint> {
                        new AttachPoint {
                            BoneName = "yourBoneName"
                        }
                    }
                });
                def.MeshPaths.Add("yourMeshName", "yourPath");
                def.ResourcePaths.Add("yourResourceName", "yourPath");
                def.TexturePaths.Add("yourTextureName", "yourPath");
                def.TranslationPaths.Add("yourTranslationName", "yourPath");
                def.CoTextures.Add("yourCoTextureName", new CoTextureDefinition {
                    Height   = 1024,
                    Width    = 1024,
                    Textures = new List <SubTextureDefinition>
                    {
                        new SubTextureDefinition {
                            Mask = "yourTextureName", Texture = "yourTextureName"
                        }
                    }
                });
                using (var ofs = new FileStream(options.TargetFile, FileMode.Create, FileAccess.Write))
                    AuthoringUtil.JsonSerialize(def, ofs);
                break;

            case "matchfile":
                var matchFile = new MatchRules();
                foreach (var t in (BoneType[])Enum.GetValues(typeof(BoneType)))
                {
                    matchFile.Bones.Add($"boneRegex{t.ToString()}", t);
                }

                foreach (var t in (AttachPointType[])Enum.GetValues(typeof(AttachPointType)))
                {
                    matchFile.AttachPoints.Add($"boneRegex{t.ToString()}", t);
                }

                using (var ofs = new FileStream(options.TargetFile, FileMode.Create, FileAccess.Write))
                    AuthoringUtil.JsonSerialize(matchFile, ofs);
                break;

            default:
                Console.Error.WriteLine("Template type not recognized");
                return(0x10103040);
            }

            return(0);
        }
Esempio n. 8
0
 public IStrikeController Create(MatchRules matchRules, Player firstPlayer)
 {
     return(new StrikeController(matchRules, firstPlayer));
 }
Esempio n. 9
0
 public SetRules(MatchRules starterRules, MatchRules counterRules)
 {
     StarterRules = starterRules;
     CounterRules = counterRules;
 }