DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦af369beb7⟧ Ada Source

    Length: 5120 (0x1400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Monkey, seg_00e3b4

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with Physicalobject;
package body Monkey is

    package Behaviour is new Classbehavior (Object, "MONKEY    ");

    procedure Make (Is_At : Coordinate;
                    On : Physical_Object := (others => ' ');
                    Holds : Physical_Object := (others => ' ')) is
        The_Monkey : Monkey.Object;
    begin
        The_Monkey.Is_At := Is_At;
        The_Monkey.On := On;
        The_Monkey.Holds := Holds;

        if The_Monkey.On /= Floor then
            declare
                Obj : Reference;

                function Same_At_Value (An_Object : Reference) return Boolean is
                begin
                    return Physicalobject.Name (An_Object) =
                              The_Monkey.On and then
                           Physicalobject.Is_At (An_Object) = The_Monkey.Is_At;
                end Same_At_Value;

                function Find_An_Object is
                   new Collection.Findone (Same_At_Value);
            begin
                Obj := Find_An_Object (Physicalobject.Instances);
                if Collection.Isnull (Obj) then
                    raise Illegal_Make;
                end if;
            end;
        end if;

        Behaviour.Allocate (The_Monkey);
    end Make;

    function Is_At (The_Reference : in Expertsystem.Reference)
                   return Coordinate is
    begin
        return Behaviour.Get (The_Reference).Is_At;
    end Is_At;

    function Is_On (The_Reference : in Expertsystem.Reference)
                   return Physical_Object is
    begin
        return Behaviour.Get (The_Reference).On;
    end Is_On;

    function Holds (The_Reference : in Expertsystem.Reference)
                   return Physical_Object is
    begin
        return Behaviour.Get (The_Reference).Holds;
    end Holds;

    procedure Modify_Coordinate (The_Reference : in Expertsystem.Reference;
                                 New_Coordinate : in Coordinate) is
        The_Object : Object;
    begin
        The_Object := Behaviour.Get (The_Reference);
        The_Object.Is_At := New_Coordinate;
        Behaviour.Set (The_Reference, The_Object);
    end Modify_Coordinate;

    procedure Modify_Is_On (The_Reference : in Expertsystem.Reference;
                            New_Object : in Physical_Object) is
        The_Object : Object;
    begin
        The_Object := Behaviour.Get (The_Reference);
        The_Object.On := New_Object;
        Behaviour.Set (The_Reference, The_Object);
    end Modify_Is_On;

    procedure Modify_Object_Held (The_Reference : in Expertsystem.Reference;
                                  New_Object : in Physical_Object) is
        The_Object : Object;
    begin
        The_Object := Behaviour.Get (The_Reference);
        The_Object.Holds := New_Object;
        Behaviour.Set (The_Reference, The_Object);
    end Modify_Object_Held;

    function Instances return Collection.Object is
    begin
        return Behaviour.Instances;
    end Instances;

    procedure Clear is
    begin
        Behaviour.Clear;
    end Clear;

end Monkey;

E3 Meta Data

    nblk1=4
    nid=0
    hdr6=8
        [0x00] rec0=1d rec1=00 rec2=01 rec3=00a
        [0x01] rec0=1e rec1=00 rec2=02 rec3=064
        [0x02] rec0=1a rec1=00 rec2=03 rec3=046
        [0x03] rec0=0b rec1=00 rec2=04 rec3=000
    tail 0x2170b0daa821e3fbcd692 0x42a00088462060003