Ejemplo n.º 1
0
        private bool CommonCheckModifierCoreAddable(ModifierCore core, string targetPlayerName)
        {
            if (core.TargetType != TypeName)
            {
                Logger.Log(LogType.Warning, $"{nameof(StarSystem)}.{nameof(AddModifier)}",
                           $"Modifier \"{core.Name}\" is not for {TypeName}, but for {core.TargetType}, so it will be ignored.");
                return(false);
            }

            if (targetPlayerName.ToLower() == "global" && core.IsPlayerExclusive)
            {
                Logger.Log(LogType.Warning, $"{nameof(StarSystem)}.{nameof(AddModifier)}",
                           $"Trying to add modifier \"{core.Name}\" as global which is player exclusive, so it will be ignored.");

                return(false);
            }

            if (targetPlayerName.ToLower() == "global" || core.IsPlayerExclusive)
            {
                return(true);
            }

            Logger.Log(LogType.Warning, $"{nameof(StarSystem)}.{nameof(AddModifier)}",
                       $"Trying to add modifier \"{core.Name}\" as player exclusive which is global, so it will be ignored.");

            return(false);
        }
Ejemplo n.º 2
0
 public TiledModifier(ModifierCore core, int adderObjectId, string rangeKey,
                      HashSet <HexTileCoord> tiles, int leftWeek)
 {
     _core            = core;
     AdderObjectId    = adderObjectId;
     _infos[rangeKey] = new TiledModifierInfo(tiles, leftWeek);
 }
Ejemplo n.º 3
0
 public Modifier(ModifierCore core, int adderObjectId, int leftWeek = -1)
 {
     _core         = core;
     AdderObjectId = adderObjectId;
     LeftWeek      = leftWeek;
 }