package com.itant.shiwushu.manager;

import com.itant.shiwushu.bean.City;

import java.util.List;

/**
 * Created by Jason on 2018/10/7.
 */

public class CityManager {
    public static CityManager instance;
    private City lostCity;
    private City foundCity;
    private City publishCity;
    private List<City> cityList;
    private CityManager() {}
    public static CityManager getInstance() {
        if (instance == null) {
            init();
        }
        return instance;
    }

    private static synchronized void init() {
        if (instance == null) {
            instance = new CityManager();
        }
    }

    public void initCity() {
        lostCity = new City();
        lostCity.setName("全部");
        lostCity.setCityId(0);

        foundCity = new City();
        foundCity.setName("全部");
        foundCity.setCityId(0);
    }

    public City getLostCity() {
        return lostCity;
    }

    public void setLostCity(City lostCity) {
        this.lostCity = lostCity;
    }

    public List<City> getCityList() {
        return cityList;
    }

    public void setCityList(List<City> cityList) {
        this.cityList = cityList;
    }

    public City getFoundCity() {
        return foundCity;
    }

    public void setFoundCity(City foundCity) {
        this.foundCity = foundCity;
    }

    public City getPublishCity() {
        return publishCity;
    }

    public void setPublishCity(City publishCity) {
        this.publishCity = publishCity;
    }

    public void restorePublishCity() {
        publishCity = new City();
    }
}
