Exemplo n.º 1
0
    public bool Assign(CrewMember crew, ShipPosition shipPos, bool asNewMemeber = false)
    {
        if (!shipPos.isManned)
        {
            if (crew.shipPos)
            {
                crew.shipPos.isManned = false;
            }

            crew.shipPos = shipPos;
            crew.role    = shipPos.getRole();

            shipPos.isManned = true;

            if (asNewMemeber)
            {
                crewMembers.Add(crew);
                crew.ship = this;
            }

            crew.BeginPath(AStar.FindPath(crew.current, shipPos.tile, true));
            return(true);
        }

        return(false);
    }
Exemplo n.º 2
0
    public void MoveToIsland()
    {
        if (!current || otherPeople.Contains(selectionManager.GetSelected()))
        {
            return;
        }

        islandContent.AddToPanel(current);
        crewContent.ReadjustPanel();

        CrewMember selected = selectionManager.GetSelected();

        playerShip.Unassign(selected);
        selected.isPlayerCrew = false;
        otherPeople.Add(selected);
        selected.BeginPath(AStar.FindPath(selected.current, beach.GetRandomTile(), true));
    }