Esempio n. 1
0
    private static void _Button(string text, string event_name, PLACE flag, float width, float height, Action call_back, object user_data)
    {
        //IL_0029: Unknown result type (might be due to invalid IL or missing references)
        //IL_002e: Expected O, but got Unknown
        //IL_0032: Unknown result type (might be due to invalid IL or missing references)
        //IL_0037: Expected O, but got Unknown
        float uIWidth = GetUIWidth(width);
        float num     = (height != 0f) ? height : BUTTON_HEIGHT;

        GUILayoutOption[] array = (GUILayoutOption[])new GUILayoutOption[2]
        {
            GUILayout.Width(uIWidth),
            GUILayout.Height(num)
        };
        _Begin(flag);
        if (GUILayout.Button(text, array) && !MonoBehaviourSingleton <UIManager> .I.IsDisable())
        {
            call_back?.Invoke();
            if (event_name.Length > 0)
            {
                MonoBehaviourSingleton <GameSceneManager> .I.ExecuteSceneEvent("TestGUI.Button", sender, event_name, user_data, null, true);
            }
        }
        if (!isBegin)
        {
            EndArea();
        }
        _End(flag);
    }
Esempio n. 2
0
    private static void _TextField(ref string text, PLACE flag, float width, float height, TextAnchor alignment)
    {
        //IL_001e: Unknown result type (might be due to invalid IL or missing references)
        //IL_0023: Unknown result type (might be due to invalid IL or missing references)
        //IL_0028: Unknown result type (might be due to invalid IL or missing references)
        //IL_002d: Expected O, but got Unknown
        //IL_002f: Unknown result type (might be due to invalid IL or missing references)
        //IL_0037: Unknown result type (might be due to invalid IL or missing references)
        //IL_003c: Unknown result type (might be due to invalid IL or missing references)
        //IL_004f: Unknown result type (might be due to invalid IL or missing references)
        //IL_0054: Expected O, but got Unknown
        //IL_0058: Unknown result type (might be due to invalid IL or missing references)
        //IL_005d: Expected O, but got Unknown
        float    uIWidth = GetUIWidth(width);
        float    num     = (height != 0f) ? height : BUTTON_HEIGHT;
        GUIStyle val     = new GUIStyle(GUI.get_skin().get_textField());

        val.set_alignment(alignment);
        val.get_normal().set_textColor(Color.get_white());
        GUILayoutOption[] array = (GUILayoutOption[])new GUILayoutOption[2]
        {
            GUILayout.Width(uIWidth),
            GUILayout.Height(num)
        };
        _Begin(flag);
        text = GUILayout.TextField(text, val, array);
        if (!isBegin)
        {
            EndArea();
        }
        _End(flag);
    }
Esempio n. 3
0
    //////////////////////
    // Auxiliar Methods //
    //////////////////////

    void SetInitialValues(PLACE leisurePlace, LeisureSchedule schedule, float satisfactionValue, int cost,
                          AVAILABILITY availability, CityPart.PLACE cityPlace)
    {
        Cost              = cost;
        LeisurePlace      = leisurePlace;
        Schedule          = schedule;
        this.availability = availability;
        LeisurePlace      = leisurePlace;
        switch (leisurePlace)
        {
        case PLACE.CINEMA: LeisureType = TYPE.SHOW; break;

        case PLACE.PARK: LeisureType = TYPE.CALM; break;

        case PLACE.GYM: LeisureType = TYPE.SPORT; break;

        case PLACE.DISCO: LeisureType = TYPE.PARTY; break;

        default: LeisureType = TYPE.CALM; break;
        }
        this.availability = availability;
        Satisfaction      = new ConditionableIndex("Satisfacción", "Representa como de satisfactorio es ir a " + Global.Names.leisurePlaces[(int)leisurePlace]
                                                   + " en el barrio " + Global.Names.cityPart[(int)cityPlace], satisfactionValue);
        CityPlace = cityPlace;
    }
Esempio n. 4
0
        public ActionResult Edit([Bind(Include = "ID,STORE_NAME,CITY,CATEGORY,EXPLANATION,ADDRESS,DETAIL_IMAGE")] PLACE pLACE)
        {
            if (ModelState.IsValid)
            {
                if (Request.Files.Count > 0)
                {
                    var file = Request.Files[0];

                    if (file != null &&
                        file.ContentLength > 0)
                    {
                        var fileName = "place_img_" + pLACE.ID + "_" + Path.GetFileName(file.FileName);
                        var path     = Path.Combine(Server.MapPath("~/images/"), fileName);
                        file.SaveAs(path);
                        pLACE.DETAIL_IMAGE = fileName;
                    }
                }
                db.Entry(pLACE).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.CATEGORY = new SelectList(db.CATEGORY, "CATEGORY_NAME", "CATEGORY_NAME", pLACE.CATEGORY);
            ViewBag.CITY     = new SelectList(db.CITY, "CITY_NAME", "CITY_NAME", pLACE.CITY);
            return(View(pLACE));
        }
    public static Vector2 GetVector2(this PLACE place)
    {
        //IL_001d: Unknown result type (might be due to invalid IL or missing references)
        //IL_0023: Unknown result type (might be due to invalid IL or missing references)
        //IL_0029: Unknown result type (might be due to invalid IL or missing references)
        //IL_002f: Unknown result type (might be due to invalid IL or missing references)
        //IL_0035: Unknown result type (might be due to invalid IL or missing references)
        switch (place)
        {
        case PLACE.FRONT:
            return(Vector2.get_up());

        case PLACE.RIGHT:
            return(Vector2.get_right());

        case PLACE.LEFT:
            return(Vector2.get_left());

        case PLACE.BACK:
            return(Vector2.get_down());

        default:
            return(Vector2.get_zero());
        }
    }
Esempio n. 6
0
        public ActionResult DeleteConfirmed(int id)
        {
            PLACE pLACE = db.PLACEs.Find(id);

            db.PLACEs.Remove(pLACE);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public Goal_MoveToAround SetParam(PLACE place, Vector3 pos, float len)
 {
     //IL_0008: Unknown result type (might be due to invalid IL or missing references)
     this.place = place;
     targetPos  = pos;
     moveLen    = len;
     return(this);
 }
Esempio n. 8
0
    private void OnAvoid(PLACE avoid_place)
    {
        //IL_001d: Unknown result type (might be due to invalid IL or missing references)
        //IL_002d: Unknown result type (might be due to invalid IL or missing references)
        //IL_0032: Unknown result type (might be due to invalid IL or missing references)
        //IL_0037: Unknown result type (might be due to invalid IL or missing references)
        //IL_0044: Unknown result type (might be due to invalid IL or missing references)
        //IL_0045: Unknown result type (might be due to invalid IL or missing references)
        //IL_004a: Unknown result type (might be due to invalid IL or missing references)
        //IL_004b: Unknown result type (might be due to invalid IL or missing references)
        //IL_0050: Unknown result type (might be due to invalid IL or missing references)
        //IL_006e: Unknown result type (might be due to invalid IL or missing references)
        //IL_006f: Unknown result type (might be due to invalid IL or missing references)
        //IL_0074: Unknown result type (might be due to invalid IL or missing references)
        //IL_0079: Unknown result type (might be due to invalid IL or missing references)
        //IL_007f: Unknown result type (might be due to invalid IL or missing references)
        //IL_0080: Unknown result type (might be due to invalid IL or missing references)
        //IL_0085: Unknown result type (might be due to invalid IL or missing references)
        //IL_008a: Unknown result type (might be due to invalid IL or missing references)
        //IL_0090: Unknown result type (might be due to invalid IL or missing references)
        //IL_0091: Unknown result type (might be due to invalid IL or missing references)
        //IL_0096: Unknown result type (might be due to invalid IL or missing references)
        //IL_009b: Unknown result type (might be due to invalid IL or missing references)
        //IL_00a1: Unknown result type (might be due to invalid IL or missing references)
        //IL_00a2: Unknown result type (might be due to invalid IL or missing references)
        //IL_00a7: Unknown result type (might be due to invalid IL or missing references)
        //IL_00ac: Unknown result type (might be due to invalid IL or missing references)
        //IL_00c3: Unknown result type (might be due to invalid IL or missing references)
        //IL_00c8: Unknown result type (might be due to invalid IL or missing references)
        //IL_00c9: Unknown result type (might be due to invalid IL or missing references)
        if (!(target == null))
        {
            Vector3 val = target._transform.get_position() - character._transform.get_position();
            val.y = 0f;
            Quaternion val2 = Quaternion.LookRotation(val);
            Vector3    val3 = Vector3.get_zero();
            switch (avoid_place)
            {
            case PLACE.FRONT:
                val3 = val2 * Vector3.get_forward();
                break;

            case PLACE.BACK:
                val3 = val2 * Vector3.get_back();
                break;

            case PLACE.LEFT:
                val3 = val2 * Vector3.get_left();
                break;

            case PLACE.RIGHT:
                val3 = val2 * Vector3.get_right();
                break;
            }
            character.LookAt(character._transform.get_position() + val3);
            player.ActAvoid();
        }
    }
Esempio n. 9
0
    //////////////////
    // Constructors //
    //////////////////

    public Leisure(PLACE leisurePlace, AVAILABILITY availability, CityPart.PLACE cityPlace)
    {
        LeisureSchedule newSchedule = new LeisureSchedule(Global.Values.leisureOpening[(int)leisurePlace],
                                                          Global.Values.leisureOpenedTime[(int)availability, (int)leisurePlace],
                                                          Global.Values.leisureTime[(int)leisurePlace]);
        float satisfactionValue = Global.Values.leisureSatisfaction[(int)leisurePlace];
        int   cost = Global.Values.leisureCost[(int)leisurePlace];

        SetInitialValues(leisurePlace, newSchedule, satisfactionValue, cost, availability, cityPlace);
    }
Esempio n. 10
0
 public ActionResult Edit([Bind(Include = "PlaceId,PlaceName,PlaceDesc,PlaceDistance,PlaceLocation,BestTime,IdealStay")] PLACE pLACE)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pLACE).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(pLACE));
 }
Esempio n. 11
0
    public bool IsPlaceTarget(PLACE place)
    {
        StageObject currentTarget = GetCurrentTarget();

        if (currentTarget == null)
        {
            return(false);
        }
        return(brain.opponentMem.IsPlaceOpponent(currentTarget, place));
    }
    public bool IsPlaceOpponent(StageObject obj, PLACE place)
    {
        OpponentRecord opponentRecord = Find(obj);

        if (opponentRecord == null)
        {
            return(false);
        }
        return(opponentRecord.record.place == place);
    }
Esempio n. 13
0
 public ActionResult Edit([Bind(Include = "ID,PLACE1")] PLACE pLACE)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pLACE).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(pLACE));
 }
Esempio n. 14
0
        public ActionResult Create([Bind(Include = "PlaceId,PlaceName,PlaceDesc,PlaceDistance,PlaceLocation,BestTime,IdealStay")] PLACE pLACE)
        {
            if (ModelState.IsValid)
            {
                db.PLACEs.Add(pLACE);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(pLACE));
        }
Esempio n. 15
0
        public ActionResult Create([Bind(Include = "ID,PLACE1")] PLACE pLACE)
        {
            if (ModelState.IsValid)
            {
                db.PLACEs.Add(pLACE);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(pLACE));
        }
Esempio n. 16
0
 protected override void Activate(Brain brain)
 {
     //IL_0088: Unknown result type (might be due to invalid IL or missing references)
     //IL_008d: Unknown result type (might be due to invalid IL or missing references)
     //IL_00bf: Unknown result type (might be due to invalid IL or missing references)
     SetStatus(STATUS.ACTIVE);
     if (!brain.targetCtrl.IsAliveTarget())
     {
         SetStatus(STATUS.COMPLETED);
     }
     else if (brain.targetCtrl.IsAttackableTarget() && brain.moveCtrl.CanBackAvoid())
     {
         AddSubGoal <Goal_Avoid>().SetPlace(PLACE.BACK);
     }
     else
     {
         float range = brain.weaponCtrl.GetAttackReach() * 2f;
         brain.moveCtrl.ChangeStopRange(range);
         if (!brain.targetCtrl.IsArrivalTarget())
         {
             AddSubGoal <Goal_GoToTarget>();
         }
         else
         {
             Vector3 targetPosition = brain.targetCtrl.GetTargetPosition();
             bool    flag           = false;
             if (Utility.Dice100(80))
             {
                 if (Utility.Coin())
                 {
                     PLACE place = (!Utility.Coin()) ? PLACE.RIGHT : PLACE.LEFT;
                     AddSubGoal <Goal_MoveToAround>().SetParam(place, targetPosition, 3f);
                 }
                 else if (brain.moveCtrl.CanRightAvoid() || brain.moveCtrl.CanLeftAvoid())
                 {
                     AddSubGoal <Goal_AvoidRightAndLeft>();
                 }
                 else
                 {
                     flag = true;
                 }
             }
             else
             {
                 flag = true;
             }
             if (flag)
             {
                 AddSubGoal <Goal_Stop>().SetGiveupTime(1f);
             }
         }
     }
 }
Esempio n. 17
0
    public static bool IsHitObstacleOrOpponentWithPlace(StageObject client, PLACE place, float range)
    {
        //IL_0001: Unknown result type (might be due to invalid IL or missing references)
        //IL_0007: Unknown result type (might be due to invalid IL or missing references)
        //IL_000c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0011: Unknown result type (might be due to invalid IL or missing references)
        //IL_0020: Unknown result type (might be due to invalid IL or missing references)
        //IL_0025: Unknown result type (might be due to invalid IL or missing references)
        Vector3 val = client.get_transform().TransformDirection(place.GetVector3());
        int     num = GetObstacleMask() | GetOpponentMask(client);

        return(Physics.Raycast(client._position, val, range, num));
    }
    protected virtual int GetWeight(ActionInfo action, DISTANCE d, PLACE p)
    {
        int num  = 0;
        int num2 = action.data.distanceWeights[(int)d];
        int num3 = action.data.placeWeights[(int)p];

        num = num2 * num3;
        if (brain.opponentMem.counter.nearNum >= 2)
        {
            num += action.data.nearMultiPlayerWeight;
        }
        return(num);
    }
Esempio n. 19
0
        public ActionResult DeleteConfirmed(int id)
        {
            PLACE pLACE = db.PLACE.Find(id);

            if (pLACE.DETAIL_IMAGE != null)
            {
                var image_path = Path.Combine(Server.MapPath("~/images/"), pLACE.DETAIL_IMAGE);
                System.IO.File.Delete(image_path);
            }

            db.PLACE.Remove(pLACE);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 20
0
        // GET: PLACEs/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PLACE pLACE = db.PLACEs.Find(id);

            if (pLACE == null)
            {
                return(HttpNotFound());
            }
            return(View(pLACE));
        }
Esempio n. 21
0
    private static void _Begin(PLACE flag)
    {
        if (!isAreaSettings)
        {
            BeginArea(AREA_TYPE.DEFAULT, 1f);
        }
        switch (flag)
        {
        case PLACE.LEFT_TOP:
            GUILayout.BeginHorizontal((GUILayoutOption[])new GUILayoutOption[0]);
            GUILayout.BeginVertical((GUILayoutOption[])new GUILayoutOption[0]);
            break;

        case PLACE.LEFT_MID:
        case PLACE.LEFT_BOTTOM:
            GUILayout.BeginHorizontal((GUILayoutOption[])new GUILayoutOption[0]);
            GUILayout.BeginVertical((GUILayoutOption[])new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            break;

        case PLACE.CENTER_TOP:
            GUILayout.BeginHorizontal((GUILayoutOption[])new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            GUILayout.BeginVertical((GUILayoutOption[])new GUILayoutOption[0]);
            break;

        case PLACE.CENTER_MID:
        case PLACE.CENTER_BOTTOM:
            GUILayout.BeginHorizontal((GUILayoutOption[])new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            GUILayout.BeginVertical((GUILayoutOption[])new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            break;

        case PLACE.RIGHT_TOP:
            GUILayout.BeginHorizontal((GUILayoutOption[])new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            GUILayout.BeginVertical((GUILayoutOption[])new GUILayoutOption[0]);
            break;

        case PLACE.RIGHT_MID:
        case PLACE.RIGHT_BOTTOM:
            GUILayout.BeginHorizontal((GUILayoutOption[])new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            GUILayout.BeginVertical((GUILayoutOption[])new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            break;
        }
    }
Esempio n. 22
0
        // GET: Place/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PLACE pLACE = db.PLACE.Find(id);

            if (pLACE == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CATEGORY = new SelectList(db.CATEGORY, "CATEGORY_NAME", "CATEGORY_NAME", pLACE.CATEGORY);
            ViewBag.CITY     = new SelectList(db.CITY, "CITY_NAME", "CITY_NAME", pLACE.CITY);
            return(View(pLACE));
        }
 protected override void Activate(Brain brain)
 {
     SetStatus(STATUS.ACTIVE);
     if (!(brain.owner is Player))
     {
         SetStatus(STATUS.COMPLETED);
     }
     else
     {
         PLACE pLACE = (!Utility.Coin()) ? PLACE.RIGHT : PLACE.LEFT;
         if (!brain.moveCtrl.CanPlaceAvoid(pLACE))
         {
             pLACE = ((pLACE == PLACE.LEFT) ? PLACE.RIGHT : PLACE.LEFT);
         }
         AddSubGoal <Goal_Avoid>().SetPlace(pLACE);
     }
 }
Esempio n. 24
0
    private static void _End(PLACE flag)
    {
        switch (flag)
        {
        case PLACE.LEFT_TOP:
        case PLACE.LEFT_MID:
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.EndVertical();
            break;

        case PLACE.LEFT_BOTTOM:
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.EndVertical();
            break;

        case PLACE.CENTER_TOP:
        case PLACE.CENTER_MID:
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.EndVertical();
            break;

        case PLACE.CENTER_BOTTOM:
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.EndVertical();
            break;

        case PLACE.RIGHT_TOP:
        case PLACE.RIGHT_MID:
            GUILayout.EndHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.EndVertical();
            break;

        case PLACE.RIGHT_BOTTOM:
            GUILayout.EndHorizontal();
            GUILayout.EndVertical();
            break;
        }
    }
    public static PLACE Reverse(this PLACE place)
    {
        switch (place)
        {
        case PLACE.FRONT:
            return(PLACE.BACK);

        case PLACE.RIGHT:
            return(PLACE.LEFT);

        case PLACE.LEFT:
            return(PLACE.RIGHT);

        case PLACE.BACK:
            return(PLACE.FRONT);

        default:
            return(place);
        }
    }
Esempio n. 26
0
    //////////////////
    // Constructors //
    //////////////////

    public CityPart(PLACE cityPlace, POPULATION population, Citizen.ECONOMIC_CLASS populationWealth, INDUSTRY industry,
                    SECTOR_INVESTMENT industryInvestment, FUN fun, SECTOR_INVESTMENT leisureInvestment,
                    INFRASTRUCTURE infrastructure, SECTOR_INVESTMENT transportInvestment, City city)
    {
        this.city             = city;
        CityPlace             = cityPlace;
        Citizens              = new Dictionary <int, Citizen>();
        nonAllocatedHomes     = new List <Coords>();
        cityHomesGrid         = new int[32, 32];
        GlobalHappiness       = new RepresentativeIndex("Felicidad Global", "Felicidad Global en el barrio " + CityPlace, 0.5f);
        GlobalHealth          = new RepresentativeIndex("Salud Global", "Salud Global en el barrio " + CityPlace, 0.5f);
        LowClassProportion    = new RepresentativeIndex("Clase Baja", "Proporción de ciudadanos de clase baja en el barrio " + CityPlace, 0.5f);
        MiddleClassProportion = new RepresentativeIndex("Clase Media", "Proporción de ciudadanos de clase media en el barrio " + CityPlace, 0.5f);
        HighClassProportion   = new RepresentativeIndex("Clase Alta", "Proporción de ciudadanos de clase alta en el barrio " + CityPlace, 0.5f);
        InitLaboralSector(industry, industryInvestment);
        InitTransportSector(infrastructure, transportInvestment);
        InitLeisureSector(fun, leisureInvestment);
        InitPopulation(population, populationWealth); // It has to be the last initialization
        //ProcessDay();
    }
Esempio n. 27
0
 protected override void Activate(Brain brain)
 {
     //IL_0031: Unknown result type (might be due to invalid IL or missing references)
     //IL_0036: Unknown result type (might be due to invalid IL or missing references)
     //IL_0043: Unknown result type (might be due to invalid IL or missing references)
     //IL_0067: Unknown result type (might be due to invalid IL or missing references)
     //IL_006c: Unknown result type (might be due to invalid IL or missing references)
     //IL_0070: Unknown result type (might be due to invalid IL or missing references)
     //IL_0075: Unknown result type (might be due to invalid IL or missing references)
     //IL_007a: Unknown result type (might be due to invalid IL or missing references)
     //IL_0083: Unknown result type (might be due to invalid IL or missing references)
     //IL_0097: Unknown result type (might be due to invalid IL or missing references)
     //IL_00ad: Unknown result type (might be due to invalid IL or missing references)
     SetStatus(STATUS.ACTIVE);
     if (!brain.targetCtrl.CanReviveOfTargetAlly())
     {
         SetStatus(STATUS.COMPLETED);
     }
     else
     {
         StageObject allyTarget = brain.targetCtrl.GetAllyTarget();
         Vector3     position   = allyTarget._transform.get_position();
         float       num        = 3f;
         if (!brain.moveCtrl.CanSeekToAlly(position, num))
         {
             PLACE      place     = Utility.Coin() ? PLACE.RIGHT : PLACE.LEFT;
             RaycastHit seekHit   = brain.moveCtrl.seekHit;
             Vector3    position2 = seekHit.get_transform().get_position();
             AddSubGoal <Goal_MoveToAround>().SetParam(place, position2, num);
         }
         else if (!brain.owner.IsArrivalPosition(position, 0f))
         {
             AddSubGoal <Goal_MoveToPosition>().SetParam(position, num);
         }
         else
         {
             SetStatus(STATUS.COMPLETED);
         }
     }
 }
Esempio n. 28
0
        // GET: Place/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PLACE pLACE = db.PLACE.Find(id);

            if (pLACE == null)
            {
                return(HttpNotFound());
            }
            if (pLACE.DETAIL_IMAGE != null)
            {
                var image_path = Path.Combine(Server.MapPath("~/images/"), pLACE.DETAIL_IMAGE);
                System.IO.File.Delete(image_path);
            }

            db.PLACE.Remove(pLACE);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 protected override void Activate(Brain brain)
 {
     //IL_0026: Unknown result type (might be due to invalid IL or missing references)
     //IL_002b: Unknown result type (might be due to invalid IL or missing references)
     //IL_003d: Unknown result type (might be due to invalid IL or missing references)
     //IL_0065: Unknown result type (might be due to invalid IL or missing references)
     //IL_006a: Unknown result type (might be due to invalid IL or missing references)
     //IL_006d: Unknown result type (might be due to invalid IL or missing references)
     //IL_0072: Unknown result type (might be due to invalid IL or missing references)
     //IL_0077: Unknown result type (might be due to invalid IL or missing references)
     //IL_007f: Unknown result type (might be due to invalid IL or missing references)
     //IL_00a3: Unknown result type (might be due to invalid IL or missing references)
     SetStatus(STATUS.ACTIVE);
     if (!brain.targetCtrl.IsAliveTarget())
     {
         SetStatus(STATUS.COMPLETED);
     }
     else
     {
         targetPos = brain.targetCtrl.GetAttackPosition();
         float num = 3f;
         if (!brain.moveCtrl.CanSeekToOpponent(targetPos, num))
         {
             PLACE      place    = Utility.Coin() ? PLACE.RIGHT : PLACE.LEFT;
             RaycastHit seekHit  = brain.moveCtrl.seekHit;
             Vector3    position = seekHit.get_transform().get_position();
             AddSubGoal <Goal_MoveToAround>().SetParam(place, position, num);
         }
         else if (!brain.targetCtrl.IsArrivalAttackPosition())
         {
             AddSubGoal <Goal_MoveToPosition>().SetParam(targetPos, num);
         }
         else
         {
             SetStatus(STATUS.COMPLETED);
         }
     }
 }
Esempio n. 30
0
        public PLACE[] diviser_PANEL(int nb_bouton, int locX_panel, int locY_panel, int width_panel, int height_panel, int nb_categ, BindingSource bs)
        {
            int nb_ligne  = nb_categ;
            int nb_colone = nb_bouton / nb_categ;

            if (nb_bouton > (nb_ligne * nb_colone))
            {
                nb_colone += 1;
            }
            PLACE[] BOUTONS            = new PLACE[nb_colone * nb_ligne];
            int     largeur_place      = width_panel / nb_colone;
            int     longueur_place     = height_panel / nb_ligne;
            int     locationX_courante = locX_panel;
            int     locationY_courante = locY_panel;
            int     btn = 0;

            for (int i = 0; i < nb_ligne; i++)
            {
                for (int j = 0; j < nb_colone; j++)
                {
                    BOUTONS[btn] = new PLACE(locationX_courante, locationY_courante, largeur_place, longueur_place, "", "");

                    locationX_courante += largeur_place;
                    btn++;
                }
                locationY_courante += longueur_place;
                locationX_courante  = locX_panel;
            }
            int h = 0;

            foreach (DataRowView drv in bs)
            {
                BOUTONS[h].CODE = drv["CODE_ARTICLE"].ToString();
                BOUTONS[h].REF  = drv["REF_ARTICLE"].ToString();
                h++;
            }
            return(BOUTONS);
        }
Esempio n. 31
0
    int MAXTRIES = 10; /* max number of tries to put down a monster */

    #endregion Fields

    #region Methods

    public void new_level()
    {
        THING tp;
        int i;

        player.t_flags &= ~ISHELD;	/* unhold when you go down just in case */
        if (level > max_level)
            max_level = level;
        /*
         * Clean things off from last level
         */
        for (i = 0; i < places.Length; i++ )
        {
            var pp = new PLACE();
            places[i] = pp;
            pp.p_ch = ' ';
            pp.p_flags = F_REAL;
            pp.p_monst = null;
        }
        clear();
        /*
         * Free up the monsters on the last level
         */
        for (tp = mlist; tp != null; tp = next(tp))
            free_list(ref tp.t_pack);
        free_list(ref mlist);
        /*
         * Throw away stuff left on the previous level (if anything)
         */
        free_list(ref lvl_obj);
        do_rooms();				/* Draw rooms */
        do_passages();			/* Draw passages */
        no_food++;
        put_things();			/* Place objects (if any) */
        /*
         * Place the traps
         */
        if (rnd(10) < level)
        {
            ntraps = rnd(level / 4) + 1;
            if (ntraps > MAXTRAPS)
                ntraps = MAXTRAPS;
            i = ntraps;
            while (i-- > 0)
            {
                /*
                 * not only wouldn't it be NICE to have traps in mazes
                 * (not that we care about being nice), since the trap
                 * number is stored where the passage number is, we
                 * can't actually do it.
                 */
                do
                {
                    find_floor(null, out stairs, 0, false);
                }
                while (chat(stairs.y, stairs.x) != FLOOR);
                int sp = flat(stairs.y, stairs.x);
                sp &= ~F_REAL;
                sp |= rnd(NTRAPS);
                flat(stairs.y, stairs.x, sp);
            }
        }
        /*
         * Place the staircase down.
         */
        find_floor(null, out stairs, 0, false);
        chat(stairs.y, stairs.x, STAIRS);
        seenstairs = false;

        for (tp = mlist; tp != null; tp = next(tp))
            tp.t_room = roomin(tp.t_pos);

        coord heroCoord;
        find_floor(null, out heroCoord, 0, true);
        hero.CopyFrom(heroCoord);
        enter_room(hero);
        mvaddch(hero.y, hero.x, PLAYER);
        if (on(player, SEEMONST))
            turn_see(0);
        if (on(player, ISHALU))
             visuals(0);
    }