Esempio n. 1
0
        public static bool IsSolder(MultipleRecords multipleRecords)
        {
            var primaryType   = multipleRecords.GetStringValue(StringConstants.PrimaryObjectType);
            var secondaryType = multipleRecords.GetStringValue(StringConstants.SecondaryObjectType);

            if (primaryType == PrimarySoldierType && secondaryType == SecondarySoldierType)
            {
                return(true);
            }
            return(false);
        }
Esempio n. 2
0
        //private SoldiersSerializer _soldiersSerializer;
        //public SoldiersSerializer SoldiersSerializer => _soldiersSerializer ?? (_soldiersSerializer = new SoldiersSerializer());

        public static void PopulateCharacter(Character character, MultipleRecords multipleRecords)
        {
            if (character is EnemyPatrol)
            {
                PopulateIPosition(character, multipleRecords);
            }
            else
            {
                PopulateIPosition(character, multipleRecords.GetMultipleRecord(StringConstants.CharacterPosition));
            }
            character.TokenId = multipleRecords.GetStringValue(StringConstants.TokenId);
            character.Angle   = multipleRecords.GetStringValue(StringConstants.Angle);
        }
Esempio n. 3
0
 public static Mission GetMission(MultipleRecords multipleRecords)
 {
     return(new Mission
     {
         MsbFileName = multipleRecords.GetStringValue(MsbFile),
         BasFileName = multipleRecords.GetStringValue(BasFile),
         Camera = SerializerHelper.Instance.CameraSerializer.Serialize(multipleRecords.GetRecord(CameraSerializer.Camera)),
         Briefing = SerializerHelper.Instance.BriefingSerializer.Serialize(multipleRecords.GetRecord(BriefingSerializer.Briefing)),
         Music = SerializerHelper.Instance.MusicSerializer.Serialize(multipleRecords.GetRecord(MusicSerializer.Music)),
         Ficheros = SerializerHelper.Instance.FicherosSerializer.Serialize(multipleRecords.GetRecord(FicherosSerializer.Ficheros)),
         Abilities = new Abilities(multipleRecords.GetMultipleRecord(StringConstants.Abilities)),
         World = SerializerHelper.Instance.WorldSerializer.Serialize(multipleRecords.GetRecord(WorldSerializer.World))
     });
 }
Esempio n. 4
0
        private static EnterDoorAction GetEnterDoorAction(MultipleRecords multipleRecords)
        {
            var action = new EnterDoorAction();

            action.MovementType = SerializerHelper.GetMovementType(multipleRecords);
            action.DoorName     = multipleRecords.GetStringValue(DoorName);
            return(action);
        }
        public static void PopulateRoutes(EnemyCharacter enemy, MultipleRecords multipleRecords)
        {
            enemy.DefaultRoute = multipleRecords.GetStringValue(DefaultRoute);
            var routes = multipleRecords.GetMixedDataRecord(Routes);

            foreach (var route in routes)
            {
                var record       = route as MultipleRecords;
                var enemyActions = new EnemyRoute();
                enemyActions.RouteName        = record.GetStringValue(RouteName);
                enemyActions.Speed            = record.GetStringValue(StringConstants.Speed);
                enemyActions.ActionRepeatType = record.GetStringValue(StringConstants.EnemyActionType);
                EnemyActionHelper.AddEnemyActions(enemyActions, record.GetMixedDataRecord(ActionStep));
                enemy.Routes.Add(enemyActions);
            }
        }
        public static bool IsCommado(MultipleRecords multipleRecords)
        {
            var tokenId = multipleRecords.GetStringValue(StringConstants.TokenId);

            switch (tokenId)
            {
            case GreenBeretToken:
            case SniperToken:
            case MarineToken:
            case SapperToken:
            case DriverToken:
            case SpyToken:
            case NatashaToken:
            case ThiefToken:
            case WilsonToken:
            case WhiskyToken:
                return(true);

            default:
                return(false);
            }
        }
        private static Commando GetCommando(MultipleRecords multipleRecords)
        {
            var tokenId = multipleRecords.GetStringValue(StringConstants.TokenId);

            switch (tokenId)
            {
            case GreenBeretToken:
                return(new GreenBeret());

            case SniperToken:
                return(new Sniper());

            case MarineToken:
                return(new Marine());

            case SapperToken:
                return(new Sapper());

            case DriverToken:
                return(new Driver());

            case SpyToken:
                return(new Spy());

            case NatashaToken:
                return(new Natasha());

            case ThiefToken:
                return(new Thief());

            //case WilsonToken:
            //  return new Wilson();
            //case WhiskyToken:
            //  return new Whisky();
            default:
                return(null);
            }
        }
Esempio n. 8
0
 public static string GetMovementType(MultipleRecords multipleRecords) => multipleRecords.GetStringValue(StringConstants.MovementType);
Esempio n. 9
0
 public static string GetSpeed(MultipleRecords multipleRecords) => multipleRecords.GetStringValue(StringConstants.Speed);
Esempio n. 10
0
 internal static string GetTime(MultipleRecords multipleRecords) => multipleRecords.GetStringValue(StringConstants.Time);
Esempio n. 11
0
 private static string GetArea(MultipleRecords multipleRecords) => multipleRecords.GetStringValue(StringConstants.Area);