This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/wait.h> | |
#include <sys/stat.h> | |
#include <sys/shm.h> | |
int main(void){ | |
int *m1,*m2,*m3,seg[3],i,j,pid = getpid(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static func parse(from details: PokemonDetailsEntity) -> PokemonDetailsViewModel { | |
var typeString = "" | |
for type in details.types { | |
typeString.append(contentsOf: "\(type) ") | |
} | |
return PokemonDetailsViewModel(name: details.name, info: " order: \(details.order)\n weight: \(details.weight)\n height: \(details.height)\n base experience: \(details.baseExperience)", id: details.id, image: URL(string: details.image) , types: typeString, mainMove: details.mainMove) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static func parse(from details: PokemonDetailsEntity) -> PokemonDetailsViewModel { | |
var typeString = "" | |
for type in details.types { | |
typeString.append(contentsOf: "\(type) ") | |
} | |
return PokemonDetailsViewModel(name: details.name, info: " order: \(details.order)\n weight: \(details.weight)\n height: \(details.height)\n base experience: \(details.baseExperience)", id: details.id, image: URL(string: details.image) , types: typeString, mainMove: details.mainMove) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static func parse(from details: PokemonDetailsEntity) -> PokemonDetailsViewModel { | |
var typeString = "" | |
for type in details.types { | |
typeString.append(contentsOf: "\(type) ") | |
} | |
return PokemonDetailsViewModel(name: details.name, | |
info: " order: \(details.order)\n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PokemonListViewController: UIViewController { | |
@IBOutlet weak var sortSegmentedControl: UISegmentedControl! | |
@IBOutlet weak var tableView: UITableView! | |
var presenter: PokemonListPresenterInput? | |
override func viewDidLoad() { | |
super.viewDidLoad() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol PokemonListPresenterInput { | |
var pokemonCount: Int { get } | |
var sortOptionsModel: [String] { get } | |
var title: String { get } | |
func viewDidLoad() | |
func didSelectCell(at index: Int) | |
func sortBy(selectedIndex: Int) | |
func getPokemon(at index: Int) -> PokemonListItemViewModel | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol PokemonListInteractorInput { | |
func fetch() | |
func findSortOptions() | |
} | |
protocol PokemonListInteractorOutput: class { | |
func fetched(pokemons: [PokemonEntity]) | |
func foundSortOptions(_ options: [SortType]) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol PokemonListManagerInput { | |
func getPokemons(completion: @escaping ([PokemonAPIModel]) -> ()) | |
} | |
class PokemonListManager: PokemonListManagerInput { | |
var objects: [PokemonAPIModel] = [] | |
func getPokemons(completion: @escaping ([PokemonAPIModel]) -> ()) { | |
PokemonAPI.shared.getPokemons { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol PokemonListManagerInput { | |
func getPokemons(completion: @escaping ([PokemonAPIModel]) -> ()) | |
} | |
class PokemonListManager: PokemonListManagerInput { | |
var objects: [PokemonAPIModel] = [] | |
func getPokemons(completion: @escaping ([PokemonAPIModel]) -> ()) { | |
PokemonAPI.shared.getPokemons { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol PokemonListManagerInput { | |
func getPokemons(completion: @escaping ([PokemonAPIModel]) -> ()) | |
} | |
class PokemonListManager: PokemonListManagerInput { | |
var objects: [PokemonAPIModel] = [] | |
func getPokemons(completion: @escaping ([PokemonAPIModel]) -> ()) { | |
PokemonAPI.shared.getPokemons { |
OlderNewer