예제 #1
0
    public HistoricalWrestlingEvent AsHistoricalEvent()
    {
        HistoricalWrestlingEvent historicalEvent = new HistoricalWrestlingEvent();

        historicalEvent.Initialize(eventName, TicketsSold, revenue, this.Type.typeName, this.EventVenue.name, this.EventInterest, this.Rating);
        return(historicalEvent);
    }
    public override void Write(object obj, ES2Writer writer)
    {
        HistoricalWrestlingEvent data = (HistoricalWrestlingEvent)obj;

        // Add your writer.Write calls here.
        writer.Write(data.name);
        writer.Write(data.revenue);
        writer.Write(data.type);
        writer.Write(data.venue);
        writer.Write(data.interest);
        writer.Write(data.rating);
        writer.Write(data.ticketsSold);
    }
예제 #3
0
    public void AddEvent(HistoricalWrestlingEvent wrestlingEvent)
    {
        float oldPopularity = this.Popularity;

        eventHistory.Insert(0, wrestlingEvent);
        float newPopularity = this.Popularity;

        if (newPopularity >= oldPopularity)
        {
            AttemptToUnlockVenue();
        }
        Save(this, SavedGameManager.Instance.CurrentGameID);
    }
    public override object Read(ES2Reader reader)
    {
        HistoricalWrestlingEvent data = new HistoricalWrestlingEvent();

        // Add your reader.Read calls here and return your object.
        data.name        = reader.Read <System.String>();
        data.revenue     = reader.Read <System.Single>();
        data.type        = reader.Read <System.String>();
        data.venue       = reader.Read <System.String>();
        data.interest    = reader.Read <System.Single>();
        data.rating      = reader.Read <System.Single>();
        data.ticketsSold = reader.Read <System.Int32>();

        return(data);
    }
예제 #5
0
    public void Generate(Company company, int phase)
    {
        string name = GenerateName();

        int   maxRosterSize = MaxRosterSize(phase);
        float money         = Utilities.ToNearest(Utilities.RandomRange(moneyRange[phase]), 10f);

        List <Wrestler> roster       = new List <Wrestler>(); // @TODO Add wrestlers if necessary
        bool            isInAlliance = (Random.Range(0, 2) == 0) ? true : false;

        company.Initialize(name, money, maxRosterSize, phase, roster, isInAlliance);

        // Since popularity is a calculated value and not a stored one, fudge it by creating a dummy event with the desired rating.
        float popularity = Utilities.RandomRange(popularityRange[phase]);
        HistoricalWrestlingEvent wrestlingEvent = new HistoricalWrestlingEvent();

        wrestlingEvent.Initialize(name + "-event0", 0, 0, "<dummy>", "<dummy>", 0f, popularity);
        company.AddEvent(wrestlingEvent);
    }