Exemplo n.º 1
0
    public void CreateHall(TriDirection dir, TriCell cell)
    {
        Hall ret = (Hall)CreateBuilding(dir, cell, (Building)TriIsleland.GetBuildingPrefabs((int)BuildingType.HALL, (int)HallType.BASE, 0));

        if (ret)
        {
            TriIsleland.Instance.entities.camp = ret;
            for (int i = 0; i < 4; i++)
            {
                Unit t = CreateUnit(ret.EntranceLocation, (Unit)TriIsleland.GetUnitPrefabs((int)UnitType.PERSON, 0));
                ((Person)t).Home = null;
                t.AddCommand(new GetInCommand(ret));
            }
            ret.Working = true;
        }
    }
Exemplo n.º 2
0
    public static new Person Load(BinaryReader reader)
    {
        Person  ret  = Instantiate((Person)TriIsleland.GetUnitPrefabs((int)UnitType.PERSON, 0));
        TriCell tLoc = TriGrid.Instance.GetCell(TriCoordinates.Load(reader));

        if (tLoc)
        {
            ret.Home = (Inn)tLoc.Statics;
        }
        tLoc = TriGrid.Instance.GetCell(TriCoordinates.Load(reader));
        if (tLoc)
        {
            ret.Company = (Company)tLoc.Statics;
        }
        tLoc = TriGrid.Instance.GetCell(TriCoordinates.Load(reader));
        if (tLoc)
        {
            ret.Work = tLoc.Statics;
        }
        return(ret);
    }