Exemple #1
0
        private static Position GetPosition(MultipleRecords multipleRecords)
        {
            var mixedDataRecord = multipleRecords.GetMixedDataRecord(StringConstants.Position);
            var x = mixedDataRecord[0].GetStringValue();
            var y = mixedDataRecord[1].GetStringValue();
            var z = mixedDataRecord[2].GetStringValue();

            return(new Position(x, y, z));
        }
        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);
            }
        }