//---- Protected Methods ----/
 protected override bool IsInteractable(CityObject cityObject) {
     if (cityObject == null) { return false; }
     Clickable clickable = cityObject.GetComponent<Clickable>();
     if (clickable != null) {
         if (!clickable.enabled) { return false; }
     }
     if (cityObject is Waypoint) { return false; }
     if (cityObject is Cloak) { return false; }
     return true;
 }
Esempio n. 2
0
        internal List<CityObject> getObjects(string list)
        {
            List<CityObject> b = new List<CityObject>();

            IDataReader reader = executeSelect("select name from " + list + "");
            
            while (reader.Read())
            {
                CityObject tmp = new CityObject(reader["name"].ToString());
                b.Add(tmp);
            }
            return b;
        }
 //---- Protected Methods ----/
 protected override bool IsInteractable(CityObject cityObject) {
     if (cityObject == null) { return false; }
     Clickable clickable = cityObject.GetComponent<Clickable>();
     if (clickable != null) {
         if (!clickable.enabled) { return false; }
     } 
     bool isPowerStation = cityObject is PowerStation;
     bool isApp = cityObject is App;
     bool isIOBuilding = cityObject is IOBuilding;
     bool isConnection = cityObject is Connection;
     bool isOrchestrator = cityObject is Orchestrator;
     bool isTransporterStation = cityObject is TransporterStation;
     bool isLion = cityObject is CityLion;
     bool isTerminal = cityObject is ClientTerminal;
     return isPowerStation || isApp || isIOBuilding || isLion || isTerminal || isConnection || isOrchestrator || isTransporterStation;
 }
Esempio n. 4
0
        internal List<CityObject> interSects(double x, double y,string type)
        {
            List<CityObject> b = new List<CityObject>();
            String sql = "SELECT c.id, c.name FROM "+ type +" c WHERE SDO_ANYINTERACT(c.shape, SDO_GEOMETRY(2001, NULL, sdo_point_type(" + x + "," + y + ",null), NULL,NULL)) = 'TRUE'";

            Console.WriteLine(sql);
            IDataReader reader = executeSelect(sql);

            while (reader.Read())
            {
                CityObject tmp = new CityObject(reader["name"].ToString());
                b.Add(tmp);
            }
            return b;
        }
 protected abstract bool IsInteractable(CityObject cityObject);
 private void OnHoverOut(CityObject cityObject) {
     cityObject.Highlight(false);
 }
    private void OnHoverOver(CityObject cityObject) {
        if (!IsInteractable(cityObject)) {
            cityObject.Highlight(false);
            return;
        }

        cityObject.Highlight(true);
        AudioManager.Instance.Play(AudioChannelIDX.GameSFX, "GridMove");
    }