示例#1
0
    public void Open(int id, string type, int length, string route, int prizePool, int additionalParam = 0)
    {
        switch (type)
        {
        case "Casual":
            Race casualRace = new CasualRace(length, route, prizePool);
            this.openedRaces[id] = casualRace;
            break;

        case "Drag":
            Race dragRace = new DragRace(length, route, prizePool);
            this.openedRaces[id] = dragRace;
            break;

        case "Drift":
            Race driftRace = new DriftRace(length, route, prizePool);
            this.openedRaces[id] = driftRace;
            break;

        case "TimeLimit":
            Race timeLimitRace = new TimeLimitRace(length, route, prizePool, additionalParam);
            this.openedRaces[id] = timeLimitRace;
            break;

        case "Circuit":
            Race circuitRace = new CircuitRace(length, route, prizePool, additionalParam);
            this.openedRaces[id] = circuitRace;
            break;
        }
    }
示例#2
0
    public Race CreaterRace(string type, int length, string route, int prizePool, params int[] aditionalParameter)
    {
        Race newRace = null;

        switch (type)
        {
        case "Casual":
            newRace = new CasualRace(length, route, prizePool);
            break;

        case "Drag":
            newRace = new DragRace(length, route, prizePool);
            break;

        case "Drift":
            newRace = new DriftRace(length, route, prizePool);
            break;

        case "Circuit":
            newRace = new CircuitRace(length, route, prizePool, aditionalParameter[0]);
            break;

        case "TimeLimit":
            newRace = new TimeLimitRace(length, route, prizePool, aditionalParameter[0]);
            break;

        default:
            throw new NotSupportedException();
        }

        return(newRace);
    }
    public void Open(int id, string type, int length, string route, int prizePool)
    {
        Race race;

        //int id = int.Parse(data[1]);
        //string type = data[2];
        //int length = int.Parse(data[3]);
        //string route = data[4];
        //int prizePool = int.Parse(data[5]);

        switch (type.ToLower())
        {
        case "drag":
            race = new DragRace(length, route, prizePool);
            //race.TypeOfRace = "DragRace";
            break;

        case "casual":
            race = new CasualRace(length, route, prizePool);
            //race.TypeOfRace = "CasualRace";
            break;

        //case "drift":
        default:
            race = new DriftRace(length, route, prizePool);
            //race.TypeOfRace = "DriftRace";
            break;
        }

        raceList.Add(id, race);
    }
示例#4
0
    public static Race CreateRace(string type, int length, string route, int prizePool, int bonus)
    {
        Race race;

        switch (type)
        {
        case "Casual":
            race = new CasualRace(length, route, prizePool);
            break;

        case "Drag":
            race = new DragRace(length, route, prizePool);
            break;

        case "Drift":
            race = new DriftRace(length, route, prizePool);
            break;

        case "TimeLimit":
            race = new TimeLimitRace(length, route, prizePool, bonus);
            break;

        case "Circuit":
            race = new CircuitRace(length, route, prizePool, bonus);
            break;

        default:
            return(null);
        }

        return(race);
    }
示例#5
0
    public void Open(int id, string type, int length, string route, int prizePool)
    {
        Race race = null;

        switch (type)
        {
        case "Casual":
            race = new CasualRace(length, route, prizePool);
            break;

        case "Drag":
            race = new DragRace(length, route, prizePool);
            break;

        case "Drift":
            race = new DriftRace(length, route, prizePool);
            break;

        default:
            break;
        }

        if (race != null)
        {
            this.allRaces[id] = race;
        }
    }
示例#6
0
 public void CreateRace(int id, string type, int length, string route, int prizePool, int optional)
 {
     if (type == "Casual")
     {
         IRace race = new CasualRace(length, route, prizePool);
         Data.races.Add(id, race);
     }
     else if (type == "Drag")
     {
         IRace race = new DragRace(length, route, prizePool);
         Data.races.Add(id, race);
     }
     else if (type == "Drift")
     {
         IRace race = new DriftRace(length, route, prizePool);
         Data.races.Add(id, race);
     }
     else if (type == "TimeLimit")
     {
         IRace race = new TimeLimitRace(length, route, prizePool, optional);
         Data.races.Add(id, race);
     }
     else if (type == "Circuit")
     {
         IRace race = new CircuitRace(length, route, prizePool, optional);
         Data.races.Add(id, race);
     }
 }
    public void Open(int id, string type, int length, string route, int prizePool)
    {
        switch (type)
        {
        case "Casual":
            races[id] = new CasualRace(length, route, prizePool);
            break;

        case "Drag":
            races[id] = new DragRace(length, route, prizePool);
            break;

        case "Drift":
            races[id] = new DriftRace(length, route, prizePool);
            break;
        }
    }
示例#8
0
 public void Open(int id, string type, int length, string route, int prizePool)
 {
     if (type == "Casual")
     {
         Race race = new CasualRace(length, route, prizePool);
         registratedRaces.Add(id, race);
     }
     else if (type == "Drag")
     {
         Race race = new DragRace(length, route, prizePool);
         registratedRaces.Add(id, race);
     }
     else if (type == "Drift")
     {
         Race race = new DriftRace(length, route, prizePool);
         registratedRaces.Add(id, race);
     }
 }
示例#9
0
 public void Open(int id, string type, int lenght, string route, int prizePool)
 {
     if (type.Equals("Casual"))
     {
         Race race = new CasualRace(lenght, route, prizePool);
         this.races.Add(id, race);
     }
     else if (type.Equals("Drag"))
     {
         Race race = new DragRace(lenght, route, prizePool);
         this.races.Add(id, race);
     }
     else if (type.Equals("Drift"))
     {
         Race race = new DriftRace(lenght, route, prizePool);
         this.races.Add(id, race);
     }
 }
示例#10
0
 public void Open(int id, string type, int length, string route, int prizePool)
 {
     if (type == "Casual")
     {
         var race = new CasualRace(id, length, route, prizePool);
         this.OpenedReces.Add(race);
     }
     else if (type == "Drag")
     {
         var race = new DragRace(id, length, route, prizePool);
         this.OpenedReces.Add(race);
     }
     else if (type == "Drift")
     {
         var race = new DriftRace(id, length, route, prizePool);
         this.OpenedReces.Add(race);
     }
 }
示例#11
0
    public void Open(int id, string type, int length, string route, int prizePool)
    {
        Race race = null;

        if (type == "Casual")
        {
            race = new CasualRace(length, route, prizePool);
        }
        else if (type == "Drag")
        {
            race = new DragRace(length, route, prizePool);
        }
        else if (type == "Drift")
        {
            race = new DriftRace(length, route, prizePool);
        }

        races[id] = race;
    }
示例#12
0
    public void Open(int id, string type, int length, string route, int prizePool)
    {
        switch (type)
        {
        case "Casual":
            CasualRace casualRace = new CasualRace(length, route, prizePool, new List <Car>());
            races.Add(id, casualRace);
            break;

        case "Drag":
            DragRace dragRace = new DragRace(length, route, prizePool, new List <Car>());
            races.Add(id, dragRace);
            break;

        case "Drift":
            DriftRace driftRace = new DriftRace(length, route, prizePool, new List <Car>());
            races.Add(id, driftRace);
            break;
        }
    }
示例#13
0
    public void Open(int id, string type, int length, string route, int prizePool)
    {
        switch (type.ToLower())
        {
        case "casual":
            Race race = new CasualRace(length, route, prizePool);
            races.Add(id, race);
            break;

        case "drag":
            Race rac = new DragRace(length, route, prizePool);
            races.Add(id, rac);
            break;

        case "drift":
            Race ra = new DriftRace(length, route, prizePool);
            races.Add(id, ra);
            break;
        }
    }
    public void Open(int id, string type, long length, string route, long prizePool)
    {
        Race race = null;

        switch (type)
        {
        case "Casual":
            race = new CasualRace(length, route, prizePool);
            break;

        case "Drag":
            race = new DragRace(length, route, prizePool);
            break;

        case "Drift":
            race = new DriftRace(length, route, prizePool);
            break;
        }

        openRaces.Add(id, race);
    }
示例#15
0
    public static Race MakeRace(int id, string type, int length, string route, int prizePool)
    {
        Race race = null;

        switch (type.ToLower())
        {
        case "casual":
            race = new CasualRace(length, route, prizePool);
            break;

        case "drift":
            race = new DriftRace(length, route, prizePool);
            break;

        case "drag":
            race = new DragRace(length, route, prizePool);
            break;
        }

        return(race);
    }
    public void Open(int id, string type, int length, string route, int prizePool)
    {
        Race currRace = null;

        switch (type)
        {
        case "Drag":
            currRace = new DragRace(length, route, prizePool);
            races.Add(id, currRace);
            break;

        case "Casual":
            currRace = new CasualRace(length, route, prizePool);
            races.Add(id, currRace);
            break;

        case "Drift":
            currRace = new DriftRace(length, route, prizePool);
            races.Add(id, currRace);
            break;
        }
    }
    public void Open(int id, string type, int length, string route, int prizePool)
    {
        //open 1 Drag 10 BeverlyHills 50000
        //Casual”, “Drag” or “Drift”.
        switch (type)
        {
        case "Drag":
            var dragRace = new DragRace(length, route, prizePool);
            CheckIsRaceExist(id, dragRace);
            break;

        case "Casual":
            var casualRace = new CasualRace(length, route, prizePool);
            CheckIsRaceExist(id, casualRace);
            break;

        case "Drift":
            var driftRace = new DriftRace(length, route, prizePool);
            CheckIsRaceExist(id, driftRace);
            break;
        }
    }
示例#18
0
    public void Open(int id, string type, int length, string route, int prizePool)
    {
        if (!id_Race.ContainsKey(id))
        {
            switch (type)
            {
            case "Casual":
                Race casualRace = new CasualRace(length, route, prizePool);
                id_Race.Add(id, casualRace);
                break;

            case "Drag":
                Race dragRace = new DragRace(length, route, prizePool);
                id_Race.Add(id, dragRace);
                break;

            case "Drift":
                Race driftRace = new DriftRace(length, route, prizePool);
                id_Race.Add(id, driftRace);
                break;
            }
        }
    }