예제 #1
0
        public Building create_building(IPositionable position, string type, double angle = 0)
        {
            var msg = new CreateBuildingMessage()
            {
                Position = position.position,
                Type     = type,
                Angle    = angle
            };

            return(new Building(client.RemoteCall <BuildingMessage>(Contracts.CreateBuilding, msg), this));
        }
예제 #2
0
        public Building create_building(IPositionable position, string type, double angle = 0)
        {
            var msg = new CreateBuildingMessage()
            {
                Position = position.position,
                Type     = type,
                Angle    = angle
            };

            Building shell = ObjectStorage.Instance.Buildings.CreateShell();

            client.RemoteCall(Contracts.CreateBuilding, msg, (ret, error) => {
                if (error != null)
                {
                    shell.AssignData(null, error);
                    return(null);
                }
                BuildingData data = (BuildingData)ret;
                ObjectStorage.Instance.Buildings.AddDataToDictionary(data);
                shell.AssignData(data);
                return(null);
            });
            return(shell);
        }