Exemplo n.º 1
0
    public static DramaReport Apply(DramaOutcomePrediction prediction)
    {
        bool willRoomBeDestroyed = Random.Range(0.0f, 1.0f) > prediction.EvaluateTotalProbabilityToSaveRoom();

        int crewQtyLoss     = prediction.CrewQtyToSacrifice;
        int resourceQtyLoss = 0;

        if (willRoomBeDestroyed)
        {
            crewQtyLoss     = prediction.Drama.Room.numberOfCrew;
            resourceQtyLoss = prediction.Drama.Room.resourcesNb;
            prediction.Drama.Room.Destroy();
        }
        else
        {
            prediction.Drama.Room.KillSome(prediction.CrewQtyToSacrifice);
        }

        return(new DramaReport(prediction.Drama.Room, resourceQtyLoss, crewQtyLoss, prediction.CrewQtyToSacrifice));
    }
Exemplo n.º 2
0
 // updates prediction upon slider change
 public void UpdatePrediction(int saved)
 {
     CurrentDramaOutcomePrediction = new DramaOutcomePrediction(CurrentDrama, saved, worldState.CurrentHope(), worldState.InitialCrew);
     Debug.Log(CurrentDramaOutcomePrediction);
 }